Index: base/i18n/time_formatting.h |
diff --git a/base/i18n/time_formatting.h b/base/i18n/time_formatting.h |
index 761dd98a5d427e8441b7b17405be2dcb39933a6b..26daf2fa6ff669653a078d072734ebbf4c5dbb74 100644 |
--- a/base/i18n/time_formatting.h |
+++ b/base/i18n/time_formatting.h |
@@ -37,6 +37,15 @@ enum DurationFormatWidth { |
DURATION_WIDTH_NUMERIC // "3:07" |
}; |
+// Date formats from third_party/icu/source/i18n/unicode/udat.h. Add more as |
+// necessary. |
+enum DateFormat { |
+ // November 2007 |
+ DATE_FORMAT_YEAR_MONTH, |
+ // Tuesday, 7 November |
+ DATE_FORMAT_MONTH_WEEKDAY_DAY, |
+}; |
jungshik at Google
2017/01/10 01:12:29
I have a mixed feeling about insulating callers fr
calamity
2017/01/16 02:49:25
I would prefer the ICU enums get hidden, just beca
|
+ |
// Returns the time of day, e.g., "3:07 PM". |
BASE_I18N_EXPORT string16 TimeFormatTimeOfDay(const Time& time); |
@@ -62,6 +71,9 @@ BASE_I18N_EXPORT string16 TimeFormatShortDateNumeric(const Time& time); |
// Returns a numeric date and time such as "12/13/52 2:44:30 PM". |
BASE_I18N_EXPORT string16 TimeFormatShortDateAndTime(const Time& time); |
+// Returns a month and year, e.g. "November 2007" |
+BASE_I18N_EXPORT string16 TimeFormatMonthAndYear(const Time& time); |
+ |
// Returns a numeric date and time with time zone such as |
// "12/13/52 2:44:30 PM PST". |
BASE_I18N_EXPORT string16 |
@@ -80,6 +92,10 @@ BASE_I18N_EXPORT string16 TimeFormatFriendlyDate(const Time& time); |
BASE_I18N_EXPORT string16 TimeDurationFormat(const TimeDelta& time, |
const DurationFormatWidth width); |
+BASE_I18N_EXPORT string16 DateIntervalFormat(const Time& begin_time, |
+ const Time& end_time, |
+ DateFormat format); |
+ |
// Gets the hour clock type of the current locale. e.g. |
// k12HourClock (en-US). |
// k24HourClock (en-GB). |