Date Field Enhancements

5 posts by 2 authors in: Forums > CMS Builder
Last Post: January 19, 2010   (RSS)

By yusuke - January 15, 2010

It doesn't seem to display as the below format.
"2010, 1, 16"

FYI: I am a CMSB user in Japan. 1 is January, 2 is Feb. and so on.
It really should be -- 2010nen 1gatu 16nichi (nen=year, gatu=month, nichi=day)

Re: [yusuke] Date Field Enhancements

By Chris - January 18, 2010 - edited: January 18, 2010

Hi yusuke,

To display dates like this on your website, you'll need to change this:

<?php echo date("D, M jS, Y g:i:s a", strtotime($record['date'])) ?>

to this:

<?php
$d = $record['date'];
echo date('Y', $d) . "nen " . date('n', $d) . "gatu " . date('j', $d) . "nichi";
?>


You may need to change the name of the date field (in red above) to match your own configuration.

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Date Field Enhancements

By yusuke - January 18, 2010

Thanks Chris!

Sorry, I wasn't clear in my post.
I was pointing out the fact that "Date Field Enhancements" preview function wasn't working as I thought it should. (Please see the attached file)
Attachments:

cmsb_fieldeditor.gif 34K

Re: [chris] Date Field Enhancements

By yusuke - January 19, 2010

Thanks Chris!

It's clear now [cool]