by Andrew Hall >> Tue, 11 Jan 2000 20:45:55 GMT
Yesterday I raised the following issue with Jade Support via the web about '99' being converted into '2099'. I accept that Jade is behaving exactly as documented in FAQ 13213 but feel it would be better if it did the following: if 2 digit date form of current year is < 50 then
if 2 digit date entered is > 50 then
century equals current century-1
otherwise
century equals current century
otherwise
if 2 digit date entered is > 50 then
century equals current century
otherwise
century equals current century+1
Does anyone agree? Or not? I've included Jade Support's response below which I must confess I don't fully understand. Their suggestion that I could have my own code to do the above logic is of course perfectly true, however the base Jade logic occurs whenever you do a '.Date' type-cast and since you can't overload a type-cast with your own logic (can you?), all '.Date' type-casts would need to be replaced with my specialist '.doDateProperly' method. Comments?
1. 11Jan00 12:40 TURING
FAQ 13213 explains the Jade's policy regarding 2 digit years. I believe this should be modified ASAP so that for 2 digit dates entered later than 1999 (ie. now in 2000) if < 50 keep the current century (ie. 20) but if > 50 then use the previous century (ie. 19). This 2nd stage of logic would reflect that already in place for pre-2000 entered dates.
2. 11Jan00 14:01 SGP
I have discussed this with the plant and the default JADE behaviour for defaulting a 2 digit year's century is not going to change.
If you have application specific requirements that differ you will need to either force the user to enter 4 digits for the year or alternately put some of your own code in to parse the appropriate fields and adjust them as appropriate prior to converting the textbox text to a date. Of course, if you put in a rule that dates > xx are 19xx your application will need adjusting again in the future when this 100 year window is no longer appropriate.
JADE's rule for defaulting the century was made such that it never needs adjusting in this way and so there is no guess-work required to determine if a given year will default to the 20th or the 21st century (or the 21st or 22nd century etc).
Contact Closed