diff --git a/platform b/platform index 25f2250016..42d4cc78a8 160000 --- a/platform +++ b/platform @@ -1 +1 @@ -Subproject commit 25f2250016bbaef11978fc2f9efc65eaa852f96c +Subproject commit 42d4cc78a873fb339a9234c671585018602c0f02 diff --git a/src/attrs.js b/src/attrs.js index 635cbee9d5..bc1dd53692 100644 --- a/src/attrs.js +++ b/src/attrs.js @@ -62,7 +62,7 @@ function takeAttributes() { // for each attribute forEach(this.attributes, function(a) { - // try to match this attribute to a property (attributess are + // try to match this attribute to a property (attributes are // all lower-case, so this is case-insensitive search) var name = propertyForAttribute.call(this, a.name); if (name) { @@ -87,7 +87,7 @@ var lowerCase = String.prototype.toLowerCase.call.bind( String.prototype.toLowerCase); - + // return the published property matching name, or undefined function propertyForAttribute(name) { // matchable properties must be published @@ -95,7 +95,7 @@ // search for a matchable property return properties[properties.map(lowerCase).indexOf(name.toLowerCase())]; }; - + function deserializeValue(inValue, inDefaultValue) { var inferredType = typeof inDefaultValue; if (inferredType === 'string') { @@ -109,6 +109,11 @@ case 'false': return false; } + + if (inDefaultValue instanceof Date) { + return new Date(Date.parse(inValue) || Date.now()); + } + var float = parseFloat(inValue); return (String(float) === inValue) ? float : inValue; } diff --git a/test/html/take-attributes.html b/test/html/take-attributes.html index 3e8ada465f..89d20cf3bd 100644 --- a/test/html/take-attributes.html +++ b/test/html/take-attributes.html @@ -59,6 +59,20 @@ + + + + + + + + + +