In Drupal 6, it was possible to set the granularity of a date field to 'minutes' but then leave time blank to allow for all day events. This functionality appears to be missing from Drupal 7. It's a pretty common use case. Is there a reason this functionality was removed?
Comments
Comment #1
harper1983 commentedSubscribe
Comment #2
rv0 commentedSubscribe
Comment #3
rv0 commentedEDIT:
you can still add "all day" events by putting the time on 00:00
Comment #4
jastraat commentedAssuming that you aren't using a 12 hour time format - otherwise the user has to enter midnight.
Which isn't terribly user-friendly.
Comment #5
rv0 commentedtrue, just to say the functionality is still in there...
i tried to add a checkbox for it with jquery, but somehow Date Popup interfered with my code.
so in my case, to make it user friendly, i did a form alter that changes the default value of the field to 00:00 if "to" date is empty (i.e. on new nodes)
it's not ideal, and i have to instruct the users that it means "all day"..
Comment #6
avdp commentedDo you have a code example perhaps?
Comment #7
rv0 commented@advp
you could put this in a custom module called custom_event
should work. (change the form_id to the id of your form)
Comment #8
avdp commented@rv0
Thank you so much. I was on the right track but the details were wrong.
Comment #9
ohnobinki commented+
Comment #10
karens commentedThis is being discussed in #874322: To Date & All Day Date Handling.