1de068b5cb
On slow computers it might happen that the user manages to login before the timezone code has a chance to run, which then causes dates to appear wrong in the UI. This fix makes sure the login cannot happen until the timezone field is set. Note that it's not possible to run the timezone code outside of document.ready() because at that time the DOM element doesn't exist yet.
10 lines
359 B
JavaScript
10 lines
359 B
JavaScript
$(document).ready(function () {
|
|
var visitortimezone = (-new Date().getTimezoneOffset() / 60);
|
|
$('#timezone-offset').val(visitortimezone);
|
|
|
|
// 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);
|
|
}
|
|
});
|