Handling invalid date incorrectly in mdl 1.8 and 1.8+

Handling invalid date incorrectly in mdl 1.8 and 1.8+

by Wen Hao Chuang -
Number of replies: 3
I just tested this again with the most recent 1.8+ code base, still behave the same way and I couldn't find any ticket about this in moodle bug tracker. Basically if the user select an invalid date open and/or close date, such as Feb 31st, and Apr 31st, moodle 1.8 (and 1.8+) will change those inputs to valid dates automatically but might not be the date that the users want (see screenshots)

reproduce procedure:
  1. Setup a quiz with an invalid open and close date (e.g. Feb 31st, Apr 31st).
  2. Leave other setting to be default.
  3. “Save changes”
It would be good to give a warning message and refocus on that field for the users to change the dates into a valid one, instead of fixing it automatically (plus two days?) and quietly.
Attachment input_invaild_date.jpg
Average of ratings: -
In reply to Wen Hao Chuang

Re: Handling invalid date incorrectly in mdl 1.8 and 1.8+

by Wen Hao Chuang -
Here is the result.
Attachment auto_change_to_vaild_date.jpg
In reply to Wen Hao Chuang

Re: Handling invalid date incorrectly in mdl 1.8 and 1.8+

by Wen Hao Chuang -
Tim should I create a ticket on bug tracker for this? If you don't have bandwidth to fix this we could help fixing it and post our solution here later, thanks!
In reply to Wen Hao Chuang

Re: Handling invalid date incorrectly in mdl 1.8 and 1.8+

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It is really a bug in the forms library (lib/formslib) so you should file a bug on that. However, feel free to devise a patch and attach it to the bug report.

Of course, an even better solution might be to get the date selector to use some sort of Javascript date selector widget. There might be one in YUI.