When creating a node with the date field and you click the All Day checkbox, the hours and minutes select boxes disappear. This, I feel implies that the hours and minutes are not required.

When you click the save button to create the node, the user is presented with the following errors.

Hour field is required.
Minute field is required.
The value input for field Date Start date is invalid:
The hour is missing.
The minute is missing.

This can be avoided by first putting in an hour and minute for the All Day event and then clicking the All Day checkbox. The node then saves properly and is listed as an (All Day) event.

It seems that a time should be inserted for the user automatically, when the All Day checkbox is utilized so as to limit confusion.

Comments

ronny89’s picture

Issue tags: +Usability

subscribe to this issue

themusician’s picture

grepping the date module I see that lots of work has occurred just to get All Day to work.

date/CHANGELOG.txt:- Issue #1233948 by KarenS, Add 'All Day' checkbox to hide/show the time parts of the date form. If All day is chosen, any time is replaced with 00:00:00 when the form is submitted.
date/CHANGELOG.txt:- Issue #1235994, Don't display 'All Day' when using a format that has no time.
date/CHANGELOG.txt:- Issue #1243842, Make sure the All Day and Show End Date flags work correctly in unlimited value fields that use ajax.
date/CHANGELOG.txt:- #1041428, by tim.plunkett: Fix logic errors in 'All Day' computations.
date/CHANGELOG.txt:- #1013662 by developer-x: Remove check for start and end date - this prevented multiday-all day events from showing 'All Day'

I think the function on line 446 of date_elements.inc can be modified to allow All Day events to be submitted with a blank time. I'll try to work on this a bit tomorrow as well. Issue #1233948 seems to have addressed this entire problem, but I guess something is still awry.

themusician’s picture

I am not entirely sure that I am moving in the correct direction. The function in date_elements.inc mentioned above merely assures submitted time is an ok format. It seems in date.theme, some work is done setting up the checkbox. What would be nice to see is, when the All Day checkbox is checked, the hours/minutes/seconds disappear but are filled in with the time, 00:00:00:am automatically.

Is date.theme the right place to patch?

tim.plunkett’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.x-dev
Category: task » bug
Priority: Minor » Normal
Issue tags: -Usability

The description in the OP sounds like #1241576: 'All day' dates are always invalid.

But I'm still hitting this with the ajax "Add another item". Add a node with multivalue date fields, make the first date all day, click add another, error.

I haven't full tracked it down, but the adjusting of the time when all day is checked is not happening early enough in validate.

Sidenote, the component should likely be renamed "Date Field". :)

karens’s picture

Component: Date CCK Field » Code
Status: Active » Fixed

Found a fix. The code in date_elements.inc is not the right place to fix this, we have to back up to the basic date element validators and make sure the expected format of the date can be adjusted when the box is checked. I fixed it with a helper function and a if function_exists() test, but it should be made into a generic hook that is implemented by the Date module to intervene in the element processing. I added a TODO to the code for that.

themusician’s picture

Fantastic KarenS. I'll check out the code and see if I can figure it out. I'll grab the latest release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.