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

Side by Side Diff: base/i18n/time_formatting.h

Issue 2607043002: [Autofill] Credit Card Autofill Last Used Date Experiment (Closed)
Patch Set: Enable unittest on android for time_formatting 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/i18n/time_formatting.cc » ('j') | base/i18n/time_formatting_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Basic time formatting methods. These methods use the current locale 5 // Basic time formatting methods. These methods use the current locale
6 // formatting for displaying the time. 6 // formatting for displaying the time.
7 7
8 #ifndef BASE_I18N_TIME_FORMATTING_H_ 8 #ifndef BASE_I18N_TIME_FORMATTING_H_
9 #define BASE_I18N_TIME_FORMATTING_H_ 9 #define BASE_I18N_TIME_FORMATTING_H_
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 TimeFormatShortDateAndTimeWithTimeZone(const Time& time); 80 TimeFormatShortDateAndTimeWithTimeZone(const Time& time);
81 81
82 // Formats a time in a friendly sentence format, e.g. 82 // Formats a time in a friendly sentence format, e.g.
83 // "Monday, March 6, 2008 2:44:30 PM". 83 // "Monday, March 6, 2008 2:44:30 PM".
84 BASE_I18N_EXPORT string16 TimeFormatFriendlyDateAndTime(const Time& time); 84 BASE_I18N_EXPORT string16 TimeFormatFriendlyDateAndTime(const Time& time);
85 85
86 // Formats a time in a friendly sentence format, e.g. 86 // Formats a time in a friendly sentence format, e.g.
87 // "Monday, March 6, 2008". 87 // "Monday, March 6, 2008".
88 BASE_I18N_EXPORT string16 TimeFormatFriendlyDate(const Time& time); 88 BASE_I18N_EXPORT string16 TimeFormatFriendlyDate(const Time& time);
89 89
90 // Formats a time using a skeleton to produce a format for different locales
91 // when unusual time format is needed, e.g.,
Mathieu 2017/01/27 15:01:44 *when an unusual
jiahuiguo 2017/02/03 07:11:17 Done.
92 // "Feb. 2, 18:00".
Mathieu 2017/01/27 15:01:44 bring to previous line
jiahuiguo 2017/02/03 07:11:17 Done.
93 //
94 // See http://userguide.icu-project.org/formatparse/datetime for details.
95 BASE_I18N_EXPORT string16 TimeFormatWithPattern(const Time& time,
96 const char* pattern);
97
90 // Formats a time duration of hours and minutes into various formats, e.g., 98 // Formats a time duration of hours and minutes into various formats, e.g.,
91 // "3:07" or "3 hours, 7 minutes". See DurationFormatWidth for details. 99 // "3:07" or "3 hours, 7 minutes". See DurationFormatWidth for details.
92 // 100 //
93 // Please don't use width = DURATION_WIDTH_NUMERIC when the time duration 101 // Please don't use width = DURATION_WIDTH_NUMERIC when the time duration
94 // can possibly be larger than 24h, as the hour value will be cut below 24 102 // can possibly be larger than 24h, as the hour value will be cut below 24
95 // after formatting. 103 // after formatting.
96 // TODO(chengx): fix function output when width = DURATION_WIDTH_NUMERIC 104 // TODO(chengx): fix function output when width = DURATION_WIDTH_NUMERIC
97 // (http://crbug.com/675791) 105 // (http://crbug.com/675791)
98 BASE_I18N_EXPORT string16 TimeDurationFormat(const TimeDelta time, 106 BASE_I18N_EXPORT string16 TimeDurationFormat(const TimeDelta time,
99 const DurationFormatWidth width); 107 const DurationFormatWidth width);
(...skipping 18 matching lines...) Expand all
118 DateFormat format); 126 DateFormat format);
119 127
120 // Gets the hour clock type of the current locale. e.g. 128 // Gets the hour clock type of the current locale. e.g.
121 // k12HourClock (en-US). 129 // k12HourClock (en-US).
122 // k24HourClock (en-GB). 130 // k24HourClock (en-GB).
123 BASE_I18N_EXPORT HourClockType GetHourClockType(); 131 BASE_I18N_EXPORT HourClockType GetHourClockType();
124 132
125 } // namespace base 133 } // namespace base
126 134
127 #endif // BASE_I18N_TIME_FORMATTING_H_ 135 #endif // BASE_I18N_TIME_FORMATTING_H_
OLDNEW
« no previous file with comments | « no previous file | base/i18n/time_formatting.cc » ('j') | base/i18n/time_formatting_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698