Bug 97636
| Summary: | [Forms] Move code fragment for current local time into common place | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | yosin |
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | ||
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 97637, 97638 | ||
yosin
There are same code fragment in
- MonthInputType::defaultValueForStepUp() http://trac.webkit.org/browser/trunk/Source/WebCore/html/MonthInputType.cpp#L88
- TimeInputType::defaultValueForStepUp() http://trac.webkit.org/browser/trunk/Source/WebCore/html/TimeInputType.cpp#L79
Note: We should have defaultValueForStepUp() for DateTimeLocalInputType and WeekInputType.
We should have function to calculate local current time, currentLocalTimeMs().
double current = currentTimeMS();
double utcOffset = calculateUTCOffset();
double dstOffset = calculateDSTOffset(current, utcOffset);
int offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
current += offset * msPerMinute;
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |