Date Format in Record List
3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 18, 2013 (RSS)
By pault - March 18, 2013
Hi,
Under 'General Settings', there's a setting for the date format, either 'Day Month Year' or 'Month Day Year'. This appears to affect the drop down date selection when editting records but not the display of dates when listing all records for a particular section.
I've found in list_functions.php, link536 the 'Y-m'd' format and wondered if you'd be able to change this for a future release please so that it formats the date based on the setting?
Thanks, Paul.
By ross - March 18, 2013
Hi Paul
Thanks for posting!
I see what you mean. When it comes to displaying date fields on your webpages, you can actually use the date() function. There should be an example right in the viewer code when you are copying and pasting it. You can then look up the options on PHP's documentation page:
http://php.net/manual/en/function.date.php
Of course, if you are saying that you know about all that and are actually suggesting we update the code so by default, the code generated by our code generator matches what is set for the time format in General Settings, that's a totally different thing :).
Let me know what you think. Thanks!
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/
By pault - March 18, 2013
Hi Ross,
Thanks, I know how to use date() on web pages but a customer has mentioned that in the listing of records within the Admin interface then date fields are shown as m-d-Y, regardless of the format defined in General Settings.
I don't mean the code generator, it's just in the CMS Builder admin pages. I found the code that defines this on line 536 in list_functions.php
if (@!$fieldSchema['showTime']) { $displayValue = date("m-d-Y", strtotime($record[$fieldname])); }
I just wondered if this could be updated to use the General Settings.
Thanks, Paul.