mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user