mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-07 17:38:02 +00:00
Merge pull request #2308 from Dogild/InvalidDateCPDatePicker
Fixed: The CPDatePicker can take invalid date
This commit is contained in:
commit
c0a2da443a
1 file changed
+8
@@ -323,6 +323,14 @@ CPEraDatePickerElementFlag = 0x0100;
|
||||
*/
|
||||
- (void)_setDateValue:(CPDate)aDateValue timeInterval:(CPTimeInterval)aTimeInterval
|
||||
{
|
||||
// Make sure to have a valid date and avoid NaN values
|
||||
if (!isFinite(aDateValue))
|
||||
{
|
||||
[CPException raise:CPInvalidArgumentException
|
||||
reason:@"aDateValue is not valid"];
|
||||
return;
|
||||
}
|
||||
|
||||
if (_minDate)
|
||||
aDateValue = new Date (MAX(aDateValue, _minDate));
|
||||
|
||||
|
||||
Reference in new issue
Block a user