Changeset 133910 in webkit
- Timestamp:
- Nov 8, 2012 9:43:20 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/Platform/ChangeLog
r133901 r133910 1 2012-11-08 Keishi Hattori <keishi@webkit.org> 2 3 Add properties for week/month picker in DateTimeChooserImpl::writeDocument 4 https://bugs.webkit.org/show_bug.cgi?id=101552 5 6 Reviewed by Kent Tamura. 7 8 * chromium/public/WebLocalizedString.h: Add WeekNumberLabel. 9 1 10 2012-11-08 Robert Kroeger <rjkroege@chromium.org> 2 11 -
trunk/Source/Platform/chromium/public/WebLocalizedString.h
r132060 r133910 103 103 ValidationValueMissingForSelect, 104 104 WeekFormatTemplate, 105 WeekNumberLabel, 105 106 }; 106 107 }; -
trunk/Source/WebKit/chromium/ChangeLog
r133904 r133910 1 2012-11-08 Keishi Hattori <keishi@webkit.org> 2 3 Add properties for week/month picker in DateTimeChooserImpl::writeDocument 4 https://bugs.webkit.org/show_bug.cgi?id=101552 5 6 Reviewed by Kent Tamura. 7 8 Changing the arguments for calendar picker to support week/month picker. 9 10 * src/DateTimeChooserImpl.cpp: 11 (WebKit::DateTimeChooserImpl::writeDocument): 12 1 13 2012-11-08 Dimitri Glazkov <dglazkov@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp
r133284 r133910 91 91 void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer) 92 92 { 93 WebCore::DateComponents date; 94 date.setMillisecondsSinceEpochForDate(m_parameters.minimum); 95 String minString = date.toString(); 96 date.setMillisecondsSinceEpochForDate(m_parameters.maximum); 97 String maxString = date.toString(); 93 WebCore::DateComponents minDate; 94 WebCore::DateComponents maxDate; 95 if (m_parameters.type == WebCore::InputTypeNames::month()) { 96 minDate.setMonthsSinceEpoch(m_parameters.minimum); 97 maxDate.setMonthsSinceEpoch(m_parameters.maximum); 98 } else if (m_parameters.type == WebCore::InputTypeNames::week()) { 99 minDate.setMillisecondsSinceEpochForWeek(m_parameters.minimum); 100 maxDate.setMillisecondsSinceEpochForWeek(m_parameters.maximum); 101 } else { 102 minDate.setMillisecondsSinceEpochForDate(m_parameters.minimum); 103 maxDate.setMillisecondsSinceEpochForDate(m_parameters.maximum); 104 } 98 105 String stepString = String::number(m_parameters.step); 99 106 String stepBaseString = String::number(m_parameters.stepBase, 11, WTF::TruncateTrailingZeros); … … 103 110 IntRect rootViewRectInScreen = m_chromeClient->rootViewToScreen(rootViewVisibleContentRect); 104 111 rootViewRectInScreen.move(-view->scrollX(), -view->scrollY()); 112 String todayLabelString; 113 if (m_parameters.type == WebCore::InputTypeNames::month()) 114 todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::ThisMonthButtonLabel); 115 else if (m_parameters.type == WebCore::InputTypeNames::week()) 116 todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::ThisWeekButtonLabel); 117 else 118 todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::CalendarToday); 105 119 106 120 addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer); … … 120 134 addProperty("confineToRootView", false, writer); 121 135 #endif 122 addProperty("min", min String, writer);123 addProperty("max", max String, writer);136 addProperty("min", minDate.toString(), writer); 137 addProperty("max", maxDate.toString(), writer); 124 138 addProperty("step", stepString, writer); 125 139 addProperty("stepBase", stepBaseString, writer); … … 127 141 addProperty("currentValue", m_parameters.currentValue, writer); 128 142 addProperty("locale", WebCore::defaultLanguage(), writer); 129 addProperty("todayLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarToday), writer);143 addProperty("todayLabel", todayLabelString, writer); 130 144 addProperty("clearLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarClear), writer); 145 addProperty("weekLabel", Platform::current()->queryLocalizedString(WebLocalizedString::WeekNumberLabel), writer); 131 146 addProperty("weekStartDay", m_locale->firstDayOfWeek(), writer); 132 147 addProperty("monthLabels", m_locale->monthLabels(), writer); … … 134 149 addProperty("isCalendarRTL", m_locale->isRTL(), writer); 135 150 addProperty("isRTL", m_parameters.isAnchorElementRTL, writer); 151 addProperty("mode", m_parameters.type.string(), writer); 136 152 if (m_parameters.suggestionValues.size()) { 137 153 addProperty("inputWidth", static_cast<unsigned>(m_parameters.anchorRectInRootView.width()), writer);
Note: See TracChangeset
for help on using the changeset viewer.