nextcloud/core/js/visitortimezone.js
Joas Schilling 5fb1bd01ff
Save the timezone on login again
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-12-08 10:53:50 +01: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);
}
}
);