Replace jquery-datetimepicker with native date input (#11684)

This removes the jQuery plugin as well as the associated config options.
Native input[type=date] does not require a language attribute as it is
localized by default, except for the placeholder attribute for which I
currently piggy-back the repo.issues.due_date_form localization option.

Implementation should pretty much match GH. Of note is that Safari does
not provide a UI for this input type, but I don't think providing one is
neccessary and GH did not bother either.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
silverwind 2020-06-10 20:35:27 +02:00 committed by GitHub
parent 42752f3902
commit 628ee1d82e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 10 additions and 232 deletions

View file

@ -12,7 +12,6 @@ import initContextPopups from './features/contextpopup.js';
import initGitGraph from './features/gitgraph.js';
import initClipboard from './features/clipboard.js';
import initUserHeatmap from './features/userheatmap.js';
import initDateTimePicker from './features/datetimepicker.js';
import initServiceWorker from './features/serviceworker.js';
import attachTribute from './features/tribute.js';
import createDropzone from './features/dropzone.js';
@ -755,18 +754,6 @@ async function initRepository() {
// Milestones
if ($('.repository.new.milestone').length > 0) {
const $datepicker = $('.milestone.datepicker');
await initDateTimePicker($datepicker.data('lang'));
$datepicker.datetimepicker({
inline: true,
timepicker: false,
startDate: $datepicker.data('start-date'),
onSelectDate(date) {
$('#deadline').val(date.toISOString().substring(0, 10));
},
});
$('#clear-date').on('click', () => {
$('#deadline').val('');
return false;