Any way to not show the time in a custom date field?
Posted: 07 October 2010 07:56 PM   [ Ignore ]
Has a Great Personality
Rank
Total Posts:  36
Joined  2010-09-08

This may be a question for EE support, but do you know if there is a way to not display the automatically generated time in a custom date field?  For example, I have a custom date field on a safecracker form where the user needs to select the date of the event they are submitting.  The field is working fine - the jquery datepicker pops out and the user can select the date.  But once they select the date, I’d like to not show the current time that is automatically entered into the field next to the date.  Right now, after someone selects a date the field looks like this: “2010-10-08 9:18 AM”.  The time is confusing to a lot of people because there shouldn’t be any time associated with this field and if they try to change it they may enter the time in the incorrect format and the entry won’t submit.  So…is there any way to hide the time so after the user selects a date it just shows the date in that field like this: “2010-10-08”?

Actually, now that I think about it, I would love to see a new custom field option similar to the safecracker file field that was just a safecracker date field without all of the localization and time properties attached to it.  Just a simple datepicker field where the user could select a date and nothing else.

Thanks!

Profile
 
 
Posted: 07 October 2010 09:06 PM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

We’re in discussions right now on alternate date formatting. We have some ideas on how to execute, we’d love to hear your ideas too.

Currently, though, you’re stuck with EE’s native date formatting style.

Profile
 
 
Posted: 07 October 2010 09:29 PM   [ Ignore ]   [ # 2 ]
Has a Great Personality
Rank
Total Posts:  36
Joined  2010-09-08

I figured we were stuck with EE’s date formatting, but I’m glad to hear that you’re looking into an alternate format.

I’d love to see just a simple datepicker field - something that works similar to the current EE date field, but isn’t tied to any server localization settings and has nothing to do with time.  All I need that field for right now is to allow a user to choose a date for an event, but if it existed I think I would use the simple date field instead of the EE date field for all of my channels where I need a custom date field.  It just gets confusing for the users to deal with fixed vs. localized dates and to see the time automatically inserted for that field.

Profile
 
 
Posted: 07 October 2010 09:31 PM   [ Ignore ]   [ # 3 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

So are you planning to use the custom date field to sort/filter/order the entries? or just display the date? I’m thinking maybe you can just use a text field and add your own custom datepicker to the entry form.

Profile
 
 
Posted: 07 October 2010 09:43 PM   [ Ignore ]   [ # 4 ]
Has a Great Personality
Rank
Total Posts:  36
Joined  2010-09-08

I just thought about that after I posted.  I am using the custom date field to sort my entries so it probably wouldn’t work to just use a text field with a datepicker on the entry form side.

I actually had to use a custom query to sort my entries properly because I’m sorting by two fields - first the date field and second a text field.  The issue I ran into is the date field is sorting entries down to the time, including seconds, so it wasn’t properly sorting by the second field because none of the entries technically had the same date, hours, minutes, and seconds in the date field.  I guess that’s another reason it would be great to have a simple date field - it would make sorting by that field a lot easier since it wouldn’t be trying to sort by the time as well.

A simple date field might be much more complicated that I thought…

Profile
 
 
Posted: 07 October 2010 09:45 PM   [ Ignore ]   [ # 5 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

If you did your dates like 10-07-2010 I bet they would sort properly.

Profile
 
 
Posted: 07 October 2010 09:48 PM   [ Ignore ]   [ # 6 ]
Has a Great Personality
Rank
Total Posts:  36
Joined  2010-09-08

True.  I guess the only issue I would run into is if someone decided to ignore the datepicker and typed in a date directly, but that probably wouldn’t be too likely.  I’ll give it a shot.

Profile
 
 
Posted: 07 October 2010 09:51 PM   [ Ignore ]   [ # 7 ]
Has a Great Personality
Rank
Total Posts:  36
Joined  2010-09-08

Actually, the other problem with just using a text field is that some of the entries are going to be entered directly through the control panel.  I can tell all the internal users to only submit entries through the safecracker form, but it would be nice if they both worked the same.  Just another thought….

Profile
 
 
Posted: 04 December 2010 03:39 AM   [ Ignore ]   [ # 8 ]
Wallflower
Avatar
Rank
Total Posts:  8
Joined  2010-12-02

Consider me another person wishing for some formatting control over what’s output here. I understand that it’s EE’s default way of doing it, but, man, the time is utterly useless in my situation. I’d even love to be able to define the formatting of the date itself so it wasn’t year-month-day, but month-day-year instead.

Profile
 
 
Posted: 04 December 2010 03:45 AM   [ Ignore ]   [ # 9 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Have a look at the example in here: http://barrettnewton.com/forums/viewthread/1271/

Profile