mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
update pikaday.js to latest and replace date inputs with pikadays
This commit is contained in:
@ -340,7 +340,7 @@
|
||||
for (i = 0; i < 7; i++) {
|
||||
arr.push('<th scope="col"><abbr title="' + renderDayName(opts, i) + '">' + renderDayName(opts, i, true) + '</abbr></th>');
|
||||
}
|
||||
return '<thead>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</thead>';
|
||||
return '<thead><tr>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</tr></thead>';
|
||||
},
|
||||
|
||||
renderTitle = function(instance, c, year, month, refYear)
|
||||
@ -357,8 +357,8 @@
|
||||
|
||||
for (arr = [], i = 0; i < 12; i++) {
|
||||
arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' +
|
||||
(i === month ? ' selected': '') +
|
||||
((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled' : '') + '>' +
|
||||
(i === month ? ' selected="selected"': '') +
|
||||
((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled="disabled"' : '') + '>' +
|
||||
opts.i18n.months[i] + '</option>');
|
||||
}
|
||||
monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month" tabindex="-1">' + arr.join('') + '</select></div>';
|
||||
@ -373,7 +373,7 @@
|
||||
|
||||
for (arr = []; i < j && i <= opts.maxYear; i++) {
|
||||
if (i >= opts.minYear) {
|
||||
arr.push('<option value="' + i + '"' + (i === year ? ' selected': '') + '>' + (i) + '</option>');
|
||||
arr.push('<option value="' + i + '"' + (i === year ? ' selected="selected"': '') + '>' + (i) + '</option>');
|
||||
}
|
||||
}
|
||||
yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year" tabindex="-1">' + arr.join('') + '</select></div>';
|
||||
@ -428,7 +428,7 @@
|
||||
}
|
||||
|
||||
if (!hasClass(target, 'is-disabled')) {
|
||||
if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) {
|
||||
if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty') && !hasClass(target.parentNode, 'is-disabled')) {
|
||||
self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));
|
||||
if (opts.bound) {
|
||||
sto(function() {
|
||||
@ -904,10 +904,7 @@
|
||||
}
|
||||
|
||||
if (typeof this._o.onDraw === 'function') {
|
||||
var self = this;
|
||||
sto(function() {
|
||||
self._o.onDraw.call(self);
|
||||
}, 0);
|
||||
this._o.onDraw(this);
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user