summaryrefslogtreecommitdiffstats
path: root/chrome/common/time_format.h
diff options
context:
space:
mode:
authormunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 20:52:08 +0000
committermunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 20:52:08 +0000
commit32a63d995d4cf1988fe8eb9ed84555d62ef9a40d (patch)
treeb17a8ba975363905b812dd8082354042c55de39b /chrome/common/time_format.h
parent4b7f783f138f5ec55da9083bf31aa7d813be68e5 (diff)
downloadchromium_src-32a63d995d4cf1988fe8eb9ed84555d62ef9a40d.zip
chromium_src-32a63d995d4cf1988fe8eb9ed84555d62ef9a40d.tar.gz
chromium_src-32a63d995d4cf1988fe8eb9ed84555d62ef9a40d.tar.bz2
Augment time_format.h/.cc to format elapsed time also.
Review URL: http://codereview.chromium.org/67186 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13874 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/time_format.h')
-rw-r--r--chrome/common/time_format.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/chrome/common/time_format.h b/chrome/common/time_format.h
index 252599b..c04ed62 100644
--- a/chrome/common/time_format.h
+++ b/chrome/common/time_format.h
@@ -18,13 +18,18 @@ class TimeDelta;
class TimeFormat {
public:
- // Returns a localized string of approximate time remaining. The conditions
- // are simpler than PastTime since this is used for in-progress operations
- // and users have different expectations of units.
- // Ex: "3 mins left", "2 days left".
+ // TimeElapsed, TimeRemaining and TimeRemainingShort functions:
+ // These functions return a localized string of approximate time duration. The
+ // conditions are simpler than PastTime since these functions are used for
+ // in-progress operations and users have different expectations of units.
+
+ // Returns times in elapsed-format: "3 mins ago", "2 days ago".
+ static std::wstring TimeElapsed(const base::TimeDelta& delta);
+
+ // Returns times in remaining-format: "3 mins left", "2 days left".
static std::wstring TimeRemaining(const base::TimeDelta& delta);
- // Same as TimeRemaining without the "left".
+ // Returns times in short-format: "3 mins", "2 days".
static std::wstring TimeRemainingShort(const base::TimeDelta& delta);
// For displaying a relative time in the past. This method returns either