JosephMajaseSithole / datejs

Automatically exported from code.google.com/p/datejs
0 stars 0 forks source link

[FIXED] No RangeError if "day out of range" #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Example: Date.parse('31')

If month does not have 31 days, the Parser is correcting to the last day of
the month. A RangeError should be thrown.  

See /test/partial/.

The core throws a RangeError.

Example:

try { 
    new Date(2007, 10, 5).set( { day: 31 } ) 
} 
catch(ex) { 
    console.log(ex) 
}

[FIXED] Moved Type checking and RangeError checks into validate*() functions. 

Reworked .add() and .set() functions. There were problems with '0' being
dealt with as a null value.

Original issue reported on code.google.com by geoff%co...@gtempaccount.com on 12 Nov 2007 at 2:02

GoogleCodeExporter commented 8 years ago
Fixed.

Original comment by geoff%co...@gtempaccount.com on 13 Nov 2007 at 12:10