Date Field Enhancements

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

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: [yusuke] Date Field Enhancements

By Chris - January 19, 2010

Hi yusuke,

We're using the somewhat-magical php function strtotime(), which is very restricted in the input it takes. While there are many ways to enter that date, I'm afraid you can't enter it with Japanese characters. Here are some examples of how you can enter Feb 1, 2010:

2010/2/1
2010-2-1
2/1/2010
1-2-2010

You can also use leading zeros on the day and/or month.

The "Preview" date is hardcoded to output in English.

We could change how any of this works through custom programming. Let me know if you're interested in that.

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 19, 2010

Thanks Chris!

It's clear now [cool]