From 774f990260bf79ba97fe44b40f4d78f4f32aa1de Mon Sep 17 00:00:00 2001 From: prssanna Date: Wed, 22 Apr 2020 12:03:35 +0530 Subject: [PATCH] fix: fix case of timestamps --- frappe/public/js/frappe/utils/pretty_date.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frappe/public/js/frappe/utils/pretty_date.js b/frappe/public/js/frappe/utils/pretty_date.js index 060ae73a98..ef235ed3b1 100644 --- a/frappe/public/js/frappe/utils/pretty_date.js +++ b/frappe/public/js/frappe/utils/pretty_date.js @@ -13,7 +13,7 @@ function prettyDate(date, mini) { // Return short format of time difference if (day_diff == 0) { if (diff < 60) { - return __("Now"); + return __("now"); } else if (diff < 3600) { return __("{0} m", [Math.floor(diff / 60)]); } else if (diff < 86400) { @@ -21,20 +21,20 @@ function prettyDate(date, mini) { } } else { if (day_diff < 7) { - return __("{0} D", [day_diff]); + return __("{0} d", [day_diff]); } else if (day_diff < 31) { - return __("{0} W", [Math.ceil(day_diff / 7)]); + return __("{0} w", [Math.ceil(day_diff / 7)]); } else if (day_diff < 365) { return __("{0} M", [Math.ceil(day_diff / 30)]); } else { - return __("{0} Y", [Math.ceil(day_diff / 365)]); + return __("{0} y", [Math.ceil(day_diff / 365)]); } } } else { // Return long format of time difference if (day_diff == 0) { if (diff < 60) { - return __("Just now"); + return __("just now"); } else if (diff < 120) { return __("1 minute ago"); } else if (diff < 3600) { @@ -46,7 +46,7 @@ function prettyDate(date, mini) { } } else { if (day_diff == 1) { - return __("Yesterday"); + return __("yesterday"); } else if (day_diff < 7) { return __("{0} days ago", [day_diff]); } else if (day_diff < 14) {