Feature/#147 automatic time conversion #150

Merged
Serraniel merged 15 commits from feature/#147-automatic-time-conversion into develop 2020-12-29 14:40:37 +01:00
Showing only changes of commit 85bd44b677 - Show all commits

View file

@ -156,6 +156,16 @@ function updateTime(node) {
return true; return true;
} }
function updateTimeZone(node) {
const HINT_UTC = 'UTC+1';
if (node.textContent === HINT_UTC) {
let tzMeta = spacetime().timezone();
console.log(tzMeta);
node.textContent = `${tzMeta.name} (UTC${tzMeta.current.offset >= 0 ? '+' : ''}${tzMeta.current.offset})`;
}
}
function updateTimestamps(node) { function updateTimestamps(node) {
let nodes = helper.findTextNodes(node); let nodes = helper.findTextNodes(node);
@ -179,5 +189,7 @@ function updateTimestamps(node) {
__alteredNodes.push(node); __alteredNodes.push(node);
return; return;
} }
updateTimeZone(node);
}); });
} }