| OLD | NEW |
| 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 #ifndef UI_BASE_L10N_TIME_FORMAT_H_ | 5 #ifndef UI_BASE_L10N_TIME_FORMAT_H_ |
| 6 #define UI_BASE_L10N_TIME_FORMAT_H_ | 6 #define UI_BASE_L10N_TIME_FORMAT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "ui/base/ui_base_export.h" | 10 #include "ui/base/ui_base_export.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // TimeElapsed, TimeRemaining* and TimeDuration*: | 22 // TimeElapsed, TimeRemaining* and TimeDuration*: |
| 23 // These functions return a localized string of approximate time duration. | 23 // These functions return a localized string of approximate time duration. |
| 24 | 24 |
| 25 // Returns times in elapsed-format: "3 mins ago", "2 days ago". | 25 // Returns times in elapsed-format: "3 mins ago", "2 days ago". |
| 26 static base::string16 TimeElapsed(const base::TimeDelta& delta); | 26 static base::string16 TimeElapsed(const base::TimeDelta& delta); |
| 27 | 27 |
| 28 // Returns times in remaining-format: "3 mins left", "2 days left". | 28 // Returns times in remaining-format: "3 mins left", "2 days left". |
| 29 static base::string16 TimeRemaining(const base::TimeDelta& delta); | 29 static base::string16 TimeRemaining(const base::TimeDelta& delta); |
| 30 | 30 |
| 31 // Returns times in remaining-long-format: "3 minutes left", "2 days left". | 31 // Returns times in remaining-long-format: "3 minutes left", "2 days left". |
| 32 // Currently, this only affects the minutes in long format, the rest | |
| 33 // of the time units are formatted the same as TimeRemaining does. | |
| 34 static base::string16 TimeRemainingLong(const base::TimeDelta& delta); | 32 static base::string16 TimeRemainingLong(const base::TimeDelta& delta); |
| 35 | 33 |
| 36 // Returns times in short-format: "3 mins", "2 days". | 34 // Returns times in short-format: "3 mins", "2 days". |
| 37 static base::string16 TimeDurationShort(const base::TimeDelta& delta); | 35 static base::string16 TimeDurationShort(const base::TimeDelta& delta); |
| 38 | 36 |
| 39 // Return times in long-format: "2 hours", "25 minutes". | 37 // Return times in long-format: "2 hours", "25 minutes". |
| 40 static base::string16 TimeDurationLong(const base::TimeDelta& delta); | 38 static base::string16 TimeDurationLong(const base::TimeDelta& delta); |
| 41 | 39 |
| 42 // For displaying a relative time in the past. This method returns either | 40 // For displaying a relative time in the past. This method returns either |
| 43 // "Today", "Yesterday", or an empty string if it's older than that. Returns | 41 // "Today", "Yesterday", or an empty string if it's older than that. Returns |
| (...skipping 12 matching lines...) Expand all Loading... |
| 56 static base::string16 RelativeDate(const base::Time& time, | 54 static base::string16 RelativeDate(const base::Time& time, |
| 57 const base::Time* optional_midnight_today); | 55 const base::Time* optional_midnight_today); |
| 58 | 56 |
| 59 private: | 57 private: |
| 60 DISALLOW_IMPLICIT_CONSTRUCTORS(TimeFormat); | 58 DISALLOW_IMPLICIT_CONSTRUCTORS(TimeFormat); |
| 61 }; | 59 }; |
| 62 | 60 |
| 63 } // namespace ui | 61 } // namespace ui |
| 64 | 62 |
| 65 #endif // UI_BASE_L10N_TIME_FORMAT_H_ | 63 #endif // UI_BASE_L10N_TIME_FORMAT_H_ |
| OLD | NEW |