Date Entry format
8 posts by 4 authors in: Forums > CMS Builder
Last Post: October 22, 2008 (RSS)
By jamtc - October 18, 2008
I want to show "DD MM YYYY" in input date entry of my date fields.
I can't see a way to do this...
Is it possible?
Will be possible in future versions of CMS?
Thanks...
Re: [jamtc] Date Entry format
By MisterJim - October 18, 2008 - edited: October 18, 2008
<?php echo date("d m Y", strtotime($record['fieldname']))?>
Make sure you change 'fieldname' to read the same as whatever the field name is for your date field.
Hope this is of some help.
Jim
Websites That Work
Re: [Mr Jim] Date Entry format
By _kate_ - October 18, 2008
I think he's talking about the input field on the CMS side rather than what is outputted on the site.
There doesn't appear to be a way to change the default display of the date field in CMSB, however there may be - perhaps Dave or someone else can confirm whether or not it's possible?
Re: [jamtc] Date Entry format
By Dave - October 20, 2008
There's no automatic day to change the form fields right now but you could move their order around by editing /lib/menus/default/edit_functions.php (make a backup first then search for "use24HourFormat" to find the place where the date fields are displayed).
Hope that helps!
interactivetools.com
Re: [Dave] Date Entry format
By jamtc - October 21, 2008
I'll wait for this feature because it is very important to users of my region.
Date entry field must have "DD-MM-YYYY" entry format and showing format too....
[unimpressed]
Re: [jamtc] Date Entry format
By Dave - October 21, 2008
And how should time be shown on the entry format? And is it 12 hour or 24 hour?
interactivetools.com
Re: [jamtc] Date Entry format
By Dave - October 22, 2008
In the meantime, you can set 24 hour format in the field editor, and if you are comfortable editing PHP you can edit this file (make a backup) to swap the date field order:
/cmsAdmin/lib/menus/default/edit_functions.php
- make backup of file
- open file for editing
- search for ":mon"
- find these two lines:
print " <select name='{$fieldSchema['name']}:mon'>$monthOptions</select>\n";
print " <select name='{$fieldSchema['name']}:day'>$dayOptions</select>\n";
and swap them like this:
print " <select name='{$fieldSchema['name']}:day'>$dayOptions</select>\n";
print " <select name='{$fieldSchema['name']}:mon'>$monthOptions</select>\n";
Hope that helps!
interactivetools.com