diff options
author | kinaba@google.com <kinaba@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-30 11:45:43 +0000 |
---|---|---|
committer | kinaba@google.com <kinaba@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-30 11:45:43 +0000 |
commit | 60e6c849cc943fa60ed599709d26051347b5abe6 (patch) | |
tree | e818adad4a2ce3184bfb4b1c35aaa6b26245449a /base/i18n/time_formatting.h | |
parent | ec3941bbe38e397d72d255fff2b0cf5100065ae4 (diff) | |
download | chromium_src-60e6c849cc943fa60ed599709d26051347b5abe6.zip chromium_src-60e6c849cc943fa60ed599709d26051347b5abe6.tar.gz chromium_src-60e6c849cc943fa60ed599709d26051347b5abe6.tar.bz2 |
Fix ChromeOS clock menu so that it can show 12-hour clock in all locales.
BUG=chromium-os:15183
TEST=Set "OS Language" to "Japanese" and open "System" setting.
Click the check box of "Use 24-hour clock".
Verify the top-right menu clock toggles (12 <--> 24).
The cause of the issue was that, the 12/24h setting is not
referred at all when time strings are formatted with AM/PM
sign dropped.
Review URL: http://codereview.chromium.org/7054032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/i18n/time_formatting.h')
-rw-r--r-- | base/i18n/time_formatting.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/base/i18n/time_formatting.h b/base/i18n/time_formatting.h index 99d1911..85c0169 100644 --- a/base/i18n/time_formatting.h +++ b/base/i18n/time_formatting.h @@ -21,14 +21,22 @@ enum HourClockType { k24HourClock, // Uses 0-23. e.g., "15:07" }; +// Argument type used to specify whether or not to include AM/PM sign. +enum AmPmClockType { + kDropAmPm, // Drops AM/PM sign. e.g., "3:07" + kKeepAmPm, // Keeps AM/PM sign. e.g., "3:07 PM" +}; + // Returns the time of day, e.g., "3:07 PM". string16 TimeFormatTimeOfDay(const Time& time); // Returns the time of day in the specified hour clock type. e.g. -// "3:07 PM" (type == k12HourClock). +// "3:07 PM" (type == k12HourClock, ampm == kKeepAmPm). +// "3:07" (type == k12HourClock, ampm == kDropAmPm). // "15:07" (type == k24HourClock). string16 TimeFormatTimeOfDayWithHourClockType(const Time& time, - HourClockType type); + HourClockType type, + AmPmClockType ampm); // Returns a shortened date, e.g. "Nov 7, 2007" string16 TimeFormatShortDate(const Time& time); @@ -36,8 +44,7 @@ string16 TimeFormatShortDate(const Time& time); // Returns a numeric date such as 12/13/52. string16 TimeFormatShortDateNumeric(const Time& time); -// Formats a time in a friendly sentence format, e.g. -// "Monday, March 6, 2008 2:44:30 PM". +// Returns a numeric date and time such as "12/13/52 2:44:30 PM". string16 TimeFormatShortDateAndTime(const Time& time); // Formats a time in a friendly sentence format, e.g. |