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

Unified Diff: base/i18n/time_formatting.cc

Issue 2570253002: [MD History] Fix toolbar dates in grouped mode. (Closed)
Patch Set: Created 4 years 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
Index: base/i18n/time_formatting.cc
diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc
index 024b86510b5a8260565dbd02eaaa376949de22a3..7e84dcc28bfc3fa4575a82fe34d42a8b2560edfd 100644
--- a/base/i18n/time_formatting.cc
+++ b/base/i18n/time_formatting.cc
@@ -141,6 +141,17 @@ string16 TimeFormatShortDateAndTimeWithTimeZone(const Time& time) {
return TimeFormat(formatter.get(), time);
}
+string16 TimeFormatMonthAndYear(const Time& time) {
+ icu::SimpleDateFormat formatter = CreateSimpleDateFormatter(UDAT_YEAR_MONTH);
+ return TimeFormat(&formatter, time);
+}
+
+string16 TimeFormatWeekdayMonthAndDay(const Time& time) {
+ icu::SimpleDateFormat formatter =
+ CreateSimpleDateFormatter(UDAT_MONTH_WEEKDAY_DAY);
+ return TimeFormat(&formatter, time);
+}
+
string16 TimeFormatFriendlyDateAndTime(const Time& time) {
std::unique_ptr<icu::DateFormat> formatter(
icu::DateFormat::createDateTimeInstance(icu::DateFormat::kFull));

Powered by Google App Engine
This is Rietveld 408576698