Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp

Issue 2418573003: date-time-local WIP
Patch Set: Fix some more Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp
index 86babf919a13e4d67a600407584e739893f81baa..7fab00de45ab0bd927b9b7aabca6e2ab5ac7ed15 100644
--- a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp
@@ -52,6 +52,13 @@ InputType* DateTimeLocalInputType::create(HTMLInputElement& element) {
return new DateTimeLocalInputType(element);
}
+String DateTimeLocalInputType::sanitizeValue(const String& proposedValue) const {
+ DateComponents date;
+ if (proposedValue.isEmpty() || !parseToDateComponents(proposedValue, &date))
+ return emptyString();
+ return date.toString();
+}
+
void DateTimeLocalInputType::countUsage() {
countUsageIfVisible(UseCounter::InputTypeDateTimeLocal);
}

Powered by Google App Engine
This is Rietveld 408576698