From 32a63d995d4cf1988fe8eb9ed84555d62ef9a40d Mon Sep 17 00:00:00 2001 From: "munjal@chromium.org" Date: Thu, 16 Apr 2009 20:52:08 +0000 Subject: 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 --- chrome/common/time_format.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'chrome/common/time_format.h') 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 -- cgit v1.1