diff --git a/src/pretix/static/datetimepicker/bootstrap-datetimepicker.js b/src/pretix/static/datetimepicker/bootstrap-datetimepicker.js index 5d2cc71557..8838cbcd24 100644 --- a/src/pretix/static/datetimepicker/bootstrap-datetimepicker.js +++ b/src/pretix/static/datetimepicker/bootstrap-datetimepicker.js @@ -1,4 +1,4 @@ -/*! version : 4.17.42 +/*! version : 4.17.47 ========================================================= bootstrap-datetimejs https://github.com/Eonasdan/bootstrap-datetimepicker @@ -142,6 +142,10 @@ if (d === undefined || d === null) { returnMoment = moment(); //TODO should this use format? and locale? + } else if (moment.isDate(d) || moment.isMoment(d)) { + // If the date that is passed in is already a Date() or moment() object, + // pass it directly to moment. + returnMoment = moment(d); } else if (hasTimeZone()) { // There is a string to parse and a default time zone // parse with the tz function which takes a default time zone if it is not in the format string returnMoment = moment.tz(d, parseFormats, options.useStrict, options.timeZone); @@ -336,6 +340,7 @@ if (use24Hours) { template.addClass('usetwentyfour'); } + if (isEnabled('s') && !use24Hours) { template.addClass('wider'); } @@ -448,15 +453,15 @@ widget.removeClass('pull-right'); } - // find the first parent element that has a relative css positioning - if (parent.css('position') !== 'relative') { + // find the first parent element that has a non-static css positioning + if (parent.css('position') === 'static') { parent = parent.parents().filter(function () { - return $(this).css('position') === 'relative'; + return $(this).css('position') !== 'static'; }).first(); } if (parent.length === 0) { - throw new Error('datetimepicker component should be placed within a relative positioned container'); + throw new Error('datetimepicker component should be placed within a non-static positioned container'); } widget.css({ @@ -686,7 +691,7 @@ currentDate, html = [], row, - clsName, + clsNames = [], i; if (!hasDate()) { @@ -717,26 +722,31 @@ } html.push(row); } - clsName = ''; + clsNames = ['day']; if (currentDate.isBefore(viewDate, 'M')) { - clsName += ' old'; + clsNames.push('old'); } if (currentDate.isAfter(viewDate, 'M')) { - clsName += ' new'; + clsNames.push('new'); } if (currentDate.isSame(date, 'd') && !unset) { - clsName += ' active'; + clsNames.push('active'); } if (!isValid(currentDate, 'd')) { - clsName += ' disabled'; + clsNames.push('disabled'); } if (currentDate.isSame(getMoment(), 'd')) { - clsName += ' today'; + clsNames.push('today'); } if (currentDate.day() === 0 || currentDate.day() === 6) { - clsName += ' weekend'; + clsNames.push('weekend'); } - row.append('