Commit b69c896d authored by Alain Takoudjou's avatar Alain Takoudjou

[erp5_web_monitoring] fixup: fix date timezone when UTC ofset is not set

parent cce22cdb
......@@ -227,6 +227,13 @@
len,
start;
function addUTCTimezone(date_string) {
if (new RegExp(/[+-][\d]{2}\:?[\d]{2}$/).test(date_string)) {
return date_string;
}
return date_string + "+0000";
}
if (status_history && status_history.hasOwnProperty('data')) {
// the status history list is reversed ([old, ...., newest])
len = status_history.data.length;
......@@ -264,9 +271,8 @@
editable: 0,
hidden: 0,
hidden_day_is_last_day: 0,
"default": (status_history.data[i].date ||
new Date(status_history.data[i]['start-date'])
.toUTCString()) + "+0000",
"default": addUTCTimezone(status_history.data[i].date ||
status_history.data[i]['start-date']),
key: "start_date",
required: 0,
timezone_style: 1,
......@@ -284,9 +290,9 @@
editable: 0,
hidden: 0,
hidden_day_is_last_day: 0,
"default": (status_history.data[i]['change-date'] ||
"default": addUTCTimezone(status_history.data[i]['change-date'] ||
new Date(status_history.data[i]['change-time'] * 1000)
.toUTCString()) + "+0000",
.toUTCString()),
key: "change_date",
required: 0,
timezone_style: 1,
......
......@@ -250,7 +250,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.57749.10471.7526</string> </value>
<value> <string>971.63542.55851.49134</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -268,7 +268,7 @@
</tuple>
<state>
<tuple>
<float>1543224382.25</float>
<float>1543572898.71</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment