fix(prettyDate): Convert datetime to user's timezone first
This commit is contained in:
parent
a58ba021e9
commit
f328d7928c
1 changed files with 3 additions and 1 deletions
|
|
@ -1,8 +1,10 @@
|
|||
function prettyDate(date, mini) {
|
||||
if (!date) return '';
|
||||
|
||||
if (typeof (date) == "string")
|
||||
if (typeof (date) == "string") {
|
||||
date = frappe.datetime.convert_to_user_tz(date);
|
||||
date = new Date((date || "").replace(/-/g, "/").replace(/[TZ]/g, " ").replace(/\.[0-9]*/, ""));
|
||||
}
|
||||
|
||||
let diff = (((new Date()).getTime() - date.getTime()) / 1000);
|
||||
let day_diff = Math.floor(diff / 86400);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue