marcomachadosantos / gwt-chronoscope

Automatically exported from code.google.com/p/gwt-chronoscope
GNU Lesser General Public License v2.1
0 stars 0 forks source link

GregorianEraCalc fails in Firefox when using extremely large dates #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The reason appears to be this line: 

  private static final EraCalc GREGORIAN_ERA_CALC = new GregorianEraCalc().init(1583, 
1999999);

This causes a call to new Date(1999999-1950)... which fails in FF, but succeeds 
in Safari. The 

public double calcYearField(double timeInMs, DateFields dateFields) {
    checkTimestampNotLessThan(timeInMs, this.minTimeStamp);
    checkTimestampLessThan(timeInMs, this.maxTimeStamp);

}

then throws unsupported operation exception. 

Both Safari and FF return NaN for something like new Date(19999999+1900, 0, 
1).getTime()

But Safari will allow setFullYear(1999999+1950, 0, 1) to succeed, whereas it 
fails on FF and 
returns NaN.

-Ray

Original issue reported on code.google.com by chadtaka...@gmail.com on 1 Jan 2009 at 12:04

GoogleCodeExporter commented 9 years ago
Resolved in r829

Original comment by chadtaka...@gmail.com on 3 Jan 2009 at 2:04