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

Side by Side Diff: Source/core/html/forms/BaseDateAndTimeInputType.cpp

Issue 394903004: document.lastModified should consider user's local time zone (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and take review comments into consideration Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/html/forms/MonthInputType.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return locale().queryString(WebLocalizedString::ValidationRangeOverflowDateT ime, localizeValue(serialize(maximum))); 83 return locale().queryString(WebLocalizedString::ValidationRangeOverflowDateT ime, localizeValue(serialize(maximum)));
84 } 84 }
85 85
86 String BaseDateAndTimeInputType::rangeUnderflowText(const Decimal& minimum) cons t 86 String BaseDateAndTimeInputType::rangeUnderflowText(const Decimal& minimum) cons t
87 { 87 {
88 return locale().queryString(WebLocalizedString::ValidationRangeUnderflowDate Time, localizeValue(serialize(minimum))); 88 return locale().queryString(WebLocalizedString::ValidationRangeUnderflowDate Time, localizeValue(serialize(minimum)));
89 } 89 }
90 90
91 Decimal BaseDateAndTimeInputType::defaultValueForStepUp() const 91 Decimal BaseDateAndTimeInputType::defaultValueForStepUp() const
92 { 92 {
93 double ms = currentTimeMS(); 93 return Decimal::fromDouble(convertToLocalTime(currentTimeMS()));
94 double utcOffset = calculateUTCOffset();
95 double dstOffset = calculateDSTOffset(ms, utcOffset);
96 int offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
97 return Decimal::fromDouble(ms + (offset * msPerMinute));
98 } 94 }
99 95
100 bool BaseDateAndTimeInputType::isSteppable() const 96 bool BaseDateAndTimeInputType::isSteppable() const
101 { 97 {
102 return true; 98 return true;
103 } 99 }
104 100
105 Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const Deci mal& defaultValue) const 101 Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const Deci mal& defaultValue) const
106 { 102 {
107 DateComponents date; 103 DateComponents date;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 { 179 {
184 return element().isRequired() && value.isEmpty(); 180 return element().isRequired() && value.isEmpty();
185 } 181 }
186 182
187 bool BaseDateAndTimeInputType::shouldShowFocusRingOnMouseFocus() const 183 bool BaseDateAndTimeInputType::shouldShowFocusRingOnMouseFocus() const
188 { 184 {
189 return true; 185 return true;
190 } 186 }
191 187
192 } // namespace blink 188 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/html/forms/MonthInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698