Browse Source

[fix] formatter if no timezone is set

version-14
Rushabh Mehta 9 years ago
parent
commit
f22592e581
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      frappe/public/js/frappe/form/formatters.js

+ 9
- 3
frappe/public/js/frappe/form/formatters.js View File

@@ -96,9 +96,15 @@ frappe.form.formatters = {
return value || "";
},
Datetime: function(value) {
return value ? moment(dateutil.convert_to_user_tz(value))
.tz(frappe.boot.sysdefaults.time_zone).format('MMMM Do YYYY, h:mm a z') : "";
//return value ? dateutil.str_to_user(dateutil.convert_to_user_tz(value)) : "";
if(value) {
var m = moment(dateutil.convert_to_user_tz(value));
if(frappe.boot.sysdefaults.time_zone) {
m = m.tz(frappe.boot.sysdefaults.time_zone);
}
return m.format('MMMM Do YYYY, h:mm a z');
} else {
return "";
}
},
Text: function(value) {
if(value) {


Loading…
Cancel
Save