display timestamps in local timezone
This commit is contained in:
parent
1a75f8c242
commit
9d91740f6e
@ -41,13 +41,11 @@ export default new Vuex.Store ({
|
||||
.then ((res) => res.json ())
|
||||
.then ((json) => json.map ((entry) => {
|
||||
entry.data = JSON.parse (entry.data);
|
||||
const time
|
||||
= (/(?<y>[0-9]+-[0-9]+-[0-9]+)T(?<t>[0-9]+:[0-9]+:[0-9]+)/u)
|
||||
.exec (
|
||||
new Date (entry.timestamp)
|
||||
.toISOString ()
|
||||
);
|
||||
entry.timestamp = `${time.groups.y} ${time.groups.t}`;
|
||||
const time = new Date (entry.timestamp);
|
||||
time.setMinutes (time.getMinutes () - time.getTimezoneOffset ());
|
||||
entry.timestamp = time.toISOString ()
|
||||
.replace ('T', ' ')
|
||||
.substr (0, 19);
|
||||
return entry;
|
||||
}));
|
||||
logs[source.name] = log;
|
||||
|
Loading…
x
Reference in New Issue
Block a user