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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « base/i18n/time_formatting.h ('k') | base/i18n/time_formatting_unittest.cc » ('j') | no next file with comments »
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 #include "base/i18n/time_formatting.h" 5 #include "base/i18n/time_formatting.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 icu::DateFormat::createDateInstance(icu::DateFormat::kShort)); 99 icu::DateFormat::createDateInstance(icu::DateFormat::kShort));
100 return TimeFormat(formatter.get(), time); 100 return TimeFormat(formatter.get(), time);
101 } 101 }
102 102
103 string16 TimeFormatShortDateAndTime(const Time& time) { 103 string16 TimeFormatShortDateAndTime(const Time& time) {
104 scoped_ptr<icu::DateFormat> formatter( 104 scoped_ptr<icu::DateFormat> formatter(
105 icu::DateFormat::createDateTimeInstance(icu::DateFormat::kShort)); 105 icu::DateFormat::createDateTimeInstance(icu::DateFormat::kShort));
106 return TimeFormat(formatter.get(), time); 106 return TimeFormat(formatter.get(), time);
107 } 107 }
108 108
109 string16 TimeFormatShortDateAndTimeWithTimeZone(const Time& time) {
110 scoped_ptr<icu::DateFormat> formatter(icu::DateFormat::createDateTimeInstance(
111 icu::DateFormat::kShort, icu::DateFormat::kLong));
112 return TimeFormat(formatter.get(), time);
113 }
114
109 string16 TimeFormatFriendlyDateAndTime(const Time& time) { 115 string16 TimeFormatFriendlyDateAndTime(const Time& time) {
110 scoped_ptr<icu::DateFormat> formatter( 116 scoped_ptr<icu::DateFormat> formatter(
111 icu::DateFormat::createDateTimeInstance(icu::DateFormat::kFull)); 117 icu::DateFormat::createDateTimeInstance(icu::DateFormat::kFull));
112 return TimeFormat(formatter.get(), time); 118 return TimeFormat(formatter.get(), time);
113 } 119 }
114 120
115 string16 TimeFormatFriendlyDate(const Time& time) { 121 string16 TimeFormatFriendlyDate(const Time& time) {
116 scoped_ptr<icu::DateFormat> formatter(icu::DateFormat::createDateInstance( 122 scoped_ptr<icu::DateFormat> formatter(icu::DateFormat::createDateInstance(
117 icu::DateFormat::kFull)); 123 icu::DateFormat::kFull));
118 return TimeFormat(formatter.get(), time); 124 return TimeFormat(formatter.get(), time);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // See http://userguide.icu-project.org/formatparse/datetime for details 158 // See http://userguide.icu-project.org/formatparse/datetime for details
153 // about the date/time format syntax. 159 // about the date/time format syntax.
154 if (pattern_unicode.indexOf('a') == -1) { 160 if (pattern_unicode.indexOf('a') == -1) {
155 return k24HourClock; 161 return k24HourClock;
156 } else { 162 } else {
157 return k12HourClock; 163 return k12HourClock;
158 } 164 }
159 } 165 }
160 166
161 } // namespace base 167 } // namespace base
OLDNEW
« no previous file with comments | « base/i18n/time_formatting.h ('k') | base/i18n/time_formatting_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698