View Issue Details

IDProjectCategoryView StatusLast Update
0004454mantisbtfilterspublic2017-04-16 18:50
Reportertom_zAssigned Tosyncguru 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionfixed 
Product Version0.19.0rc1 
Target Version2.4.0Fixed in Version 
Summary0004454: 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

TagsNo tags attached.

Relationships

related to 0015276 assignedsyncguru Custom field "Date" 31 days every month. 
child of 0004181 closed Features in Mantis 1.1 release 
child of 0015281 assignedsyncguru Consistent user interface for date fields 

Activities

2004-09-01 08:21

 

mantis.bug.gif (30,426 bytes)
mantis.bug.gif (30,426 bytes)
jlatour

jlatour

2004-09-01 17:10

reporter   ~0007365

Does it really matter all that much? Nice layout by the way!

vboctor

vboctor

2004-09-01 17:24

manager   ~0007367

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.

jlatour

jlatour

2004-09-01 17:26

reporter   ~0007370

Fine, fine... it can't hurt.

anarcat

anarcat

2005-08-05 14:47

reporter   ~0011083

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");
$end = $date->getPrevDay();
print $end->getDay();

(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.

ryandesign

ryandesign

2005-08-07 16:30

reporter   ~0011106

Don't need a PEAR module to do that...

function last_day_of_month($month, $year) {
return date('d', mktime(12, 0, 0, $month + 1, 0, $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.

giallu

giallu

2007-08-05 09:19

reporter   ~0015351

Any reason why we can't just use:

http://www.php.net/checkdate

to validate the date?

vboctor

vboctor

2007-08-05 17:27

manager   ~0015354

We have two options:

  1. Validate after Submit - In this case we can use checkdate().

  2. Disallow choosing an invalid date - In this case use a Javascript calendar control, I would also keep the server side checkdate() validation. If Javascript is disabled, then we can fall back to our current date entry interface + checkdate() validation.
atrol

atrol

2017-03-30 16:02

developer   ~0056286

Fixed by changes in PR to fix 0008957

cproensa

cproensa

2017-04-16 18:50

developer   ~0056592

Reopened. Due to regressions, the changes have been reverted and will be targeted to next release

Issue History

Date Modified Username Field Change
2004-09-01 08:21 tom_z New Issue
2004-09-01 08:21 tom_z File Added: mantis.bug.gif
2004-09-01 17:10 jlatour Note Added: 0007365
2004-09-01 17:10 jlatour Status new => feedback
2004-09-01 17:24 vboctor Note Added: 0007367
2004-09-01 17:26 jlatour Note Added: 0007370
2004-09-01 17:26 jlatour Status feedback => acknowledged
2004-09-01 17:27 jlatour Relationship added child of 0004181
2005-07-16 09:46 grangeway Severity block => minor
2005-08-05 14:47 anarcat Note Added: 0011083
2005-08-07 16:30 ryandesign Note Added: 0011106
2007-08-05 09:19 giallu Note Added: 0015351
2007-08-05 17:27 vboctor Note Added: 0015354
2012-12-11 16:48 atrol Relationship added related to 0015276
2012-12-12 10:56 dregad Relationship added child of 0015281
2017-03-30 16:02 atrol Assigned To => syncguru
2017-03-30 16:02 atrol Status acknowledged => resolved
2017-03-30 16:02 atrol Resolution open => fixed
2017-03-30 16:02 atrol Fixed in Version => 2.3.0
2017-03-30 16:02 atrol Note Added: 0056286
2017-03-30 16:02 atrol Target Version => 2.3.0
2017-04-01 00:13 vboctoradmin Status resolved => closed
2017-04-16 18:50 cproensa Status closed => assigned
2017-04-16 18:50 cproensa Fixed in Version 2.3.0 =>
2017-04-16 18:50 cproensa Target Version 2.3.0 => 2.4.0
2017-04-16 18:50 cproensa Note Added: 0056592