View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004454 | mantisbt | filters | public | 2004-09-01 08:21 | 2018-02-07 02:47 |
Reporter | tom_z | Assigned To | syncguru | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | assigned | Resolution | fixed | ||
Product Version | 0.19.0rc1 | ||||
Summary | 0004454: 31 February ??? | ||||
Description | to refine filter, there's no control if the date is correct or not! | ||||
Additional Information | i suggest this calander javascript from www.totallysmartit.com | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Does it really matter all that much? Nice layout by the way! |
|
I don't think it does matter, although we should be validating the filter dates on submit. However, in my opinion this problem will go away if/when we use a calendar control. |
|
Fine, fine... it can't hurt. |
|
The PEAR Date module is really useful to deal with dates and stuff like this. For example, the last day of the month could be found using an incantation like this: $date = new Date("2005-07-01"); (This will print "30"). Of course, the problem in the first place is the fact that you're free to choose a different month, but anyways... this at least gives an easy way to find the theorical bounds. |
|
Don't need a PEAR module to do that... function last_day_of_month($month, $year) { This would of course only be useful as a check that could be performed when submitting the form, to determine if the date is valid, and if it isn't, show an error then, and make the user go back to fix it. This would be fine IMHO. To prevent the user from selecting an invalid date in the first place would involve a pretty complicated JavaScript and will most likely just annoy the user anyway: What if "February 28" is currently selected, and she wants to select "January 31", but tries to do so by changing the day select menu first, and then the month? A JavaScript that says "Beep: Invalid date!" as soon as she's got February 31 selected is just going to tick her off. And leap years are a PITA too. |
|
Any reason why we can't just use: to validate the date? |
|
We have two options:
|
|
Fixed by changes in PR to fix 0008957 |
|
Reopened. Due to regressions, the changes have been reverted and will be targeted to next release |
|