-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Description
var x = "1497810600000" //string casted timestamp
then, new Date(X) --> Invalid date.
The constructor of Date Object allows string input for long form of date only and not timestamp.
Can we update the deserialize function in Polymer.Base (probably in _deserializeValue () method of property-accessors.html) with following:
case 'Date':
var serialized;
if(value instanceof Date) {
serialized = Polymer.Base.deserialize(value, 'Date').getTime();
} else {
value = isNaN(value) ? value : Number(value);
serialized = new Date(value).getTime();
}
break;