14 Aug 2012 4:27 PM #1
Which date field has the 'greater' date?
I have a form with 2 date fields.
Inside the select event of each, I want to check to see if it is 'greater' (after) than the other. How do I do that?
It should be EASY - but this is a classic example of the ExtJS docs reminding me of the Seinfeld episode 'A lot about nothing'.
14 Aug 2012 5:09 PM #2
- Join Date
- Apr 2007
- Sydney, Australia
- Vote Rating
Not sure what this has to do with the Ext docs.
Should we include a section "How to check if one date is greater than another date".
Anyway, it is easy and it's done in JS:
// May also want to deal with nulls var d1 = field1.getValue().getTime(), d2 = field2.getValue().getTime(); console.log(d1 > d2);Evan Trimboli
Twitter - @evantrimboli
Don't be afraid of the source code!