I would like to remove the new "all day" checkbox for one of my projects. Users should enter the time for an event as a mandatory field.

Comments

vasike’s picture

Issue tags: +event

subscribe.
i think this could be "caused" also by a this feature #1258300: Add option to set default time values and hide time entry

bak’s picture

Subscribe.
The option to disable "All Day" is highly recommended.

Anonymous’s picture

Subscribe
This is causing real problems for me. I don't want my users to be able to select "all day".

rickvug’s picture

Title: make "all day" checkbox optional » Make "all day" checkbox configurable on a per field instance basis
Priority: Normal » Major

Agreed. The "all day" tickbox makes sense as a widget setting. To give a real world usage example, I presently have a project with Events, where "all day" is really useful and a separate publishing date field, where "all day" doesn't make any sense.

adamgerthel’s picture

+1

We use date module on a site where users select their child's date and time of birth. "All day" is not really applicable for when the baby arrives (although I suppose it could be possible in a sense :P )

marcoscano’s picture

subscribe

magnusk’s picture

I also find this checkbox inadequate in certain contexts.

Sometimes I really want the user to pick a time. So I don't want that checkbox at all.

Sometimes I would like to allow for an empty time field, which does not necessarily mean it's an "all day" value, it could just be that the time is not yet known, or not important. So even if I'd be fine with the checkbox functionality, I'd like to display a different legend for it (e.g. "time tbd"). And the checkbox should then be inside the fieldset rather than above it.

marktheshark’s picture

This thread is about 7.x-2.x-dev, but I'd like to ask about 6.x.

How do you make the "All day" check-box appear? I have exact opposite problem: haven't been able to create a single all-day event ever... It always forces me to enter hours and minutes as well.

Thank you

13rac1’s picture

Subscribe. I don't want this feature on my date fields. It needs to be optional.

@marktheshark: To make the "All day" check box appear, you must install Drupal 7. It is a Drupal 7 feature only, unless backported.

13rac1’s picture

Status: Active » Needs review
StatusFileSize
new18.73 KB

That was simple enough. Attached is a patch making the All Day checkbox optional. Defaults to disabled, so the All Day feature won't affect existing page designs.

FYI: My text editor removed a lot of end-of-line whitespace also.

spcalpo’s picture

The patch didn't work for me, unfortunately.

patching file date.field.inc
Hunk #3 succeeded at 334 (offset 24 lines).
Hunk #4 succeeded at 373 (offset 24 lines).
Hunk #5 succeeded at 387 (offset 24 lines).
Hunk #6 succeeded at 414 (offset 24 lines).
Hunk #7 succeeded at 431 (offset 24 lines).
Hunk #8 succeeded at 465 (offset 24 lines).
Hunk #9 succeeded at 487 (offset 24 lines).
patching file date_admin.inc
Hunk #11 succeeded at 187 with fuzz 1.
Hunk #14 succeeded at 412 with fuzz 1 (offset -19 lines).
patching file date_elements.inc
Hunk #1 succeeded at 47 with fuzz 2 (offset -13 lines).
Hunk #2 FAILED at 107.
Hunk #3 FAILED at 240.
Hunk #4 succeeded at 281 (offset -28 lines).
Hunk #5 succeeded at 311 (offset -26 lines).
Hunk #6 succeeded at 433 (offset -24 lines).
Hunk #7 succeeded at 481 (offset -23 lines).
Hunk #8 succeeded at 551 (offset -23 lines).
Hunk #9 succeeded at 575 (offset -22 lines).
2 out of 9 hunks FAILED -- saving rejects to file date_elements.inc.rej

I have Date version 7.x-2.0-alpha4.

spcalpo’s picture

Never mind. Noticed this was for the dev version so I installed that and the patch worked. Thanks eosrei.

Update: I can't actually find the admin option for enabling/disabling the "all day" checkbox :( So now it's always disabled and that's not what I wanted either.

13rac1’s picture

@Sally, you may need to clear the Drupal cache to see the new settings. Last I installed this patch it worked correctly and is on a live site right now.

spcalpo’s picture

I tried refreshing cache but still don't see the option, unfortunately. I've been trying to view it by creating a new date field for a custom content type, then editing the field (both the new field type, and the instance for that content type). Neither of those pages show the option to toggle 'all day'. I'm not sure if I am just looking in the wrong place, though.

I'm thankful for such a useful patch, I just wish I could use it!

spcalpo’s picture

(Double post, sorry)

vulfox’s picture

+1

Lots of "All day" issues here...

Thrixke’s picture

Title: Make "all day" checkbox configurable on a per field instance basis » Partially applied patch causing error
Category: feature » bug
Priority: Major » Normal

I just downloaded the 2.x dev version (release date: 15th of nov 2011) of the date module in order to apply your patch. Unfortunately, my IDE said the patch could only be applied partially. I tried anyway, visited my content type to check wether I do have the option to enable/disable the 'all day' checkbox. The option is there. But, when saving my content type, I get this error:

Notice: Undefined index: display_all_day in _date_field_widget_settings_form() (line 265 of date/date_admin.inc)

The checkbox is still there when I try to create new content. Is the patch not working on the latest dev 2.x?

karens’s picture

Title: Partially applied patch causing error » Make "all day" checkbox configurable on a per field instance basis

Resetting issue title

Thrixke’s picture

Sorry, forget about it.

I applied the patch manually. Now it works perfectly!

Thank you very much.

13rac1’s picture

Category: bug » feature
Priority: Normal » Major

Resetting other settings. If it works perfectly, please change the status to RTBC.

arlinsandbulte’s picture

Please do not mix code changes with cosmetic changes (whitespace changes).
It makes a simple patch MUCH more difficult to review and troubleshoot (both now and if it needs to be revisited in the future).

Attached is a patch without the whitespace corrections against the latest -dev.
This looks good and I tested it successfully...

arlinsandbulte’s picture

Status: Needs review » Fixed
arlinsandbulte’s picture

Also note: users can STILL create 'all day' events even though the checkbox is gone:

For a date field with no To Date (To Date set to Never), it is labeled as "All Day" when the time equals 12:00AM.
For a date field with a To Date ('To Date' is set to Optional or Required), it is labeled as "All Day" ONLY when both the From Date & To Date times are on the same day AND both set to 12:00AM.

But that is another issue here: #874322: To Date & All Day Date Handling

13rac1’s picture

Thanks for committing this much needed change. I wasn't aware how many whitespace error corrections were in the patch, until you mentioned it.

karens’s picture

I made a follow up tweak to this -- I moved it down by the increment setting so the form sets up year and then time options, and I added a step to not show the setting on dates without time.

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