Presently the default 'now' values are a hinderance - and lead to incorrectly filled forms.
Events can have just a start (by having the same end time) but this isn't clear.
There seems to be little user input validation.

Proposed solution:

Make 'end' clearly optional. Say so and have it blank by default.
Add validation checks, that can also handle blank end dates.

Notes:

Validation is ruthless, it maybe worth changing some to 'use default value' and drupal_set_message. Rather than form_set_error? If so which ones, when?
Added an id tag to make it possible for future js to enable optional auto-filling of end time form start

CommentFileSizeAuthor
#3 event-end.patch.txt8.49 KBcharlesc
event.20060612.patch.txt9.93 KBekes

Comments

RayZ’s picture

Title: Making end date 'optional' and vaildation of input » Making end date 'optional' and validation of input
Category: task » feature
dodorama’s picture

This sounds like a useful feature. But I think that this patch doesn't apply to the last event module. I run the patch and two trunks failed. These are the results of the patching process:

patching file event.module
Hunk #1 succeeded at 1073 (offset -8 lines).
Hunk #2 succeeded at 1310 (offset -8 lines).
Hunk #3 FAILED at 1418.
Hunk #4 succeeded at 1452 (offset -8 lines).
Hunk #5 succeeded at 1522 (offset 6 lines).
Hunk #6 succeeded at 1873 (offset 6 lines).
Hunk #7 FAILED at 1885.
Hunk #8 succeeded at 1985 (offset 43 lines).
Hunk #9 succeeded at 2009 (offset 43 lines).
2 out of 9 hunks FAILED -- saving rejects to file event.module.rej

Anyone knows how to update this patch?
Any plan to include this feature in core?

Thanks for this great module.

charlesc’s picture

Category: feature » support
StatusFileSize
new8.49 KB

I manually patched the event.module and build a patch file for it.

csc4’s picture

This seems like a really useful patch - is there any chance of it being committed?

killes@www.drop.org’s picture

I think a imple text below the form which explains how it works would be better.

BobLouis’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

The above patch doesn't seem to apply to 5.1 version.

Is there a way to solve this issue :
- make end date optional
- validate start date and end date (eg: start date >= today, end date >= start date, etc.)

I understand we can use the Forms API. If that is the solution, could someone give an example of the code to use to perform date format checks (since I am not a php programmer at all!).

Your help is appreciated!

michelle’s picture

Status: Needs review » Closed (duplicate)

See http://drupal.org/node/147558 to co-ordinate discussion of UI change.

Michelle