Fix milestone deadline and date related problems (#32339)

Use zero instead of 9999-12-31 for deadline
Fix #32291

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
Lunny Xiao 2024-11-04 23:46:40 -08:00 committed by GitHub
parent 1887c75c35
commit 24b83ff63e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 147 additions and 165 deletions

View file

@ -1,11 +1,9 @@
import $ from 'jquery';
export function initRepoMilestone() {
// Milestones
if ($('.repository.new.milestone').length > 0) {
$('#clear-date').on('click', () => {
$('#deadline').val('');
return false;
});
}
const page = document.querySelector('.repository.new.milestone');
if (!page) return;
const deadline = page.querySelector<HTMLInputElement>('form input[name=deadline]');
document.querySelector('#milestone-clear-deadline').addEventListener('click', () => {
deadline.value = '';
});
}