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

Unified Diff: base/i18n/time_formatting.h

Issue 2570253002: [MD History] Fix toolbar dates in grouped mode. (Closed)
Patch Set: use date interval format Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/i18n/time_formatting.cc » ('j') | chrome/browser/ui/webui/browsing_history_handler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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).
« no previous file with comments | « no previous file | base/i18n/time_formatting.cc » ('j') | chrome/browser/ui/webui/browsing_history_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698