Some small JS fixes for eslint compliance

main
MichiK 6 years ago
parent ed5ee3235e
commit 44e33eb2de

@ -1,3 +1,5 @@
const moment = require('moment');
/** /**
* Sets all checkboxes to the wanted state * Sets all checkboxes to the wanted state
* *
@ -116,7 +118,7 @@ $(function () {
elem.children('input').attr('type', 'text'); elem.children('input').attr('type', 'text');
elem.children().on('click', function (ev) { elem.children().on('click', function (ev) {
ev.stopImmediatePropagation(); ev.stopImmediatePropagation();
if (elem.data('DateTimePicker') === undefined) { if (typeof elem.data('DateTimePicker') === "undefined") {
elem.datetimepicker(opts); elem.datetimepicker(opts);
elem.data('DateTimePicker').show(); elem.data('DateTimePicker').show();
} else { } else {
@ -156,11 +158,11 @@ $(function () {
elem.find('button').on('click', function () { elem.find('button').on('click', function () {
var input = elem.children('input').first(); var input = elem.children('input').first();
input.val(moment().format('HH:mm')); input.val(moment().format('HH:mm'));
var day_selector = $('#' + input.attr('id').replace('time', 'day')); var daySelector = $('#' + input.attr('id').replace('time', 'day'));
var days = day_selector.children('option'); var days = daySelector.children('option');
days.each(function (i) { days.each(function (i) {
if ($(days[i]).val() === moment().format('YYYY-MM-DD')) { if ($(days[i]).val() === moment().format('YYYY-MM-DD')) {
day_selector.val($(days[i]).val()); daySelector.val($(days[i]).val());
return false; return false;
} }
}); });

Loading…
Cancel
Save