When selecting a date using the JS popup date selector, clicking Clear will only clear the date. I cannot think of any possible use case where one would want to clear the date but would not want to clear the time. Thus, a user clears the date, tries to submit the form, the date field doesn't validate because the time field hasn't been cleared. This could be very confusing to some users, and it also makes them spend some extra time to clear the time field. And clearing the time field isn't exactly intuitive either; only the Delete key and not the more widely used Backspace key will clear the time field.

Comments

Mike Wacker’s picture

Status: Active » Needs review
StatusFileSize
new348 bytes
new638 bytes

Attached is a patch for the 5.2 branch that should do the trick. It adds a small jQuery file (which is located in the same directory as the date_popup.module) which will clear the time when the date is changed to nothing. It also requires adding a single line of code to the module to load the jQuery file. It shouldn't be hard at all to replicate this patch for other branches.

david lesieur’s picture

Version: 5.x-2.5 » 6.x-2.x-dev
Status: Needs review » Needs work
StatusFileSize
new1.33 KB

Here is a port to the DRUPAL-6--2 branch. This code is not generic enough for inclusion with the date_popup module, but it may help some people.

arlinsandbulte’s picture

Status: Needs work » Closed (won't fix)

I think the clear button on the popup calendar has been removed since this issue.
(not sure if date module did this or an update in jquery ui)
See this: #458352: No 'clear' button in date popup

I'm not sure if I should really close this, but if anyone would like (and it is possible) feel free to re-open & add a patch to bring back the clear button and add this functionality.

Thanks