Index: Source/core/html/forms/BaseDateAndTimeInputType.cpp |
diff --git a/Source/core/html/forms/BaseDateAndTimeInputType.cpp b/Source/core/html/forms/BaseDateAndTimeInputType.cpp |
index bf87e948cc0f52c30c0bc49b9912411dd1313c28..33a7ab77c0fbd0ffca314c81c2767aebddd701a1 100644 |
--- a/Source/core/html/forms/BaseDateAndTimeInputType.cpp |
+++ b/Source/core/html/forms/BaseDateAndTimeInputType.cpp |
@@ -60,7 +60,7 @@ void BaseDateAndTimeInputType::setValueAsDate(double value, ExceptionState&) con |
double BaseDateAndTimeInputType::valueAsDouble() const |
{ |
- const Decimal value = parseToNumber(element().value(), Decimal::nan()); |
+ const Decimal value = parseToNumber(element().value(), String(), Decimal::nan()); |
return value.isFinite() ? value.toDouble() : DateComponents::invalidMilliseconds(); |
} |
@@ -103,10 +103,10 @@ bool BaseDateAndTimeInputType::isSteppable() const |
return true; |
} |
-Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const Decimal& defaultValue) const |
+Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const String& alternative, const Decimal& defaultValue) const |
{ |
DateComponents date; |
- if (!parseToDateComponents(source, &date)) |
+ if (!parseToDateComponents(source, &date) && !parseToDateComponents(alternative, &date)) |
return defaultValue; |
double msec = date.millisecondsSinceEpoch(); |
ASSERT(std::isfinite(msec)); |