openvk/Web/static/js/timezone.js

12 lines
452 B
JavaScript
Raw Permalink Normal View History

// This file is included only when there is no info about timezone in users's chandler session
xhr = new XMLHttpRequest();
xhr.open("POST", "/iapi/timezone", true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
2022-01-30 13:06:04 +03:00
xhr.onload = (response) => {
if(JSON.parse(response.originalTarget.responseText).success == 1) {
window.location.reload();
}
};
xhr.send('timezone=' + new Date().getTimezoneOffset());