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

Unified Diff: base/i18n/time_formatting.cc

Issue 2607043002: [Autofill] Credit Card Autofill Last Used Date Experiment (Closed)
Patch Set: Add date formatter based on pattern 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
Index: base/i18n/time_formatting.cc
diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc
index fde255fa71e19d76a70fc570a0eb5c52c7b4cc8d..f4235952b41f053c6b420d335e6a4c331b30c720 100644
--- a/base/i18n/time_formatting.cc
+++ b/base/i18n/time_formatting.cc
@@ -153,6 +153,11 @@ string16 TimeFormatFriendlyDate(const Time& time) {
return TimeFormat(formatter.get(), time);
}
+string16 TimeFormatWithPattern(const Time& time, const char* pattern) {
+ icu::SimpleDateFormat formatter = CreateSimpleDateFormatter(pattern);
+ return TimeFormat(&formatter, time);
+}
+
string16 TimeDurationFormat(const TimeDelta time,
const DurationFormatWidth width) {
UErrorCode status = U_ZERO_ERROR;

Powered by Google App Engine
This is Rietveld 408576698