Is it possible to adjust the format date in entered for custom field of “date”. Currently the calendar pop-up is great but it always enters hrs values along with date. 2010-02-15 7:31 PM vs. desired just the date 2010-02-15 Anything that can ‘hacked up’ on front end or it pretty much the field definition on mysql side? Thank you!
Hi Lebisol,
There is no way to change the format for the built in Date field type. You would have to create a new field type based on the existing one. If you do this you’ll see that the displayed format is specified in system/expressionengine/fieldtypes/ft.date.php on or about line 105.
Cheers
Greg
I was able to create a new fieldtype that sports the Date field and removes the time output. This is my first attempt at anything like this and I cannot completely guarantee its perfection by any stretch of the imagination. But it could be a start!
Right now it sets the date as “Fixed” and removes the drop down for “Localization” or “Fixed”. I also have this set to output JUST the date and no time.
Hope it helps!
Ah got it. Nice work so far as it does work on CP side but here is a few things I noticed: - in CP it shows up as ‘Textarea’ for FieldType - in template the custom field does not show up at all
{mydate}
{mydate format="%F %d %Y"}Thanks Reusser and no pressure on this I am just reporting back.
Thanks! I should’ve mentioned that I did not test it on the frontend, I just peeked at the information in the database. 😊 It came up with the date and no time and I just made an assumption that it came out correctly on the frontend side of things.
Unfortunately I am not too versed in CI so perhaps someone else could take a stab at it? I’m with you though. I pine for a better date/time field and interaction with EE entries. I’d love to see a date field with just the date, a time field for inputting time separately, and the ability to use those fields as the “entry” and “expiration” date.
I think from a client perspective it is easy to misinterpret what the entry and expiration fields could mean.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.