server/core/js/visitortimezone.js
2014-09-22 14:01:45 +02:00

12 lines
385 B
JavaScript

/* global jstz */
$(document).ready(function () {
$('#timezone-offset').val((-new Date().getTimezoneOffset() / 60));
$('#timezone').val(jstz.determine().name());
// only enable the submit button once we are sure that the timezone is set
var $loginForm = $('form[name="login"]');
if ($loginForm.length) {
$loginForm.find('input#submit').prop('disabled', false);
}
}
);