fix conflict issue in sticker pdf service
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 20s
Laravel Pint / pint (pull_request) Failing after 2m32s
Laravel Larastan / larastan (pull_request) Failing after 5m36s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 20s
Laravel Pint / pint (pull_request) Failing after 2m32s
Laravel Larastan / larastan (pull_request) Failing after 5m36s
This commit is contained in:
@@ -64,88 +64,58 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
});
|
||||
|
||||
|
||||
// var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
// initialView: 'dayGridMonth',
|
||||
// height: 600,
|
||||
// showNonCurrentDates: true,
|
||||
// function updateWorkingDays(date) {
|
||||
// let totalDays = new Date(
|
||||
// date.getFullYear(),
|
||||
// date.getMonth()+1,
|
||||
// 0
|
||||
// ).getDate();
|
||||
|
||||
// dateClick: function(info) {
|
||||
// let workingDays = totalDays - selectedDates.length;
|
||||
// // document.querySelector('input[name="working_days"]').value = workingDays;
|
||||
|
||||
// let viewMonth = calendar.view.currentStart.getMonth();
|
||||
// let clickedMonth = info.date.getMonth();
|
||||
// const input = document.querySelector('#working_days');
|
||||
|
||||
// // let month = info.date.getMonth() + 1; // JS month: 0-11 → 1-12
|
||||
// // let year = info.date.getFullYear();
|
||||
// input.value = workingDays;
|
||||
|
||||
// if (viewMonth != clickedMonth) {
|
||||
// return; // Ignore next/prev month dates
|
||||
// }
|
||||
// input.dispatchEvent(new Event('input'));
|
||||
|
||||
// let dateStr = info.dateStr;
|
||||
// const monthInput = document.querySelector('#month');
|
||||
// monthInput.value = date.getMonth() + 1; // 1–12 month number
|
||||
// monthInput.dispatchEvent(new Event('input'));
|
||||
|
||||
// if (selectedDates.includes(dateStr)) {
|
||||
// selectedDates = selectedDates.filter(d => d !== dateStr);
|
||||
// const yearInput = document.querySelector('#year');
|
||||
// yearInput.value = date.getFullYear();
|
||||
// yearInput.dispatchEvent(new Event('input'));
|
||||
|
||||
// calendar.getEvents().forEach(event => {
|
||||
// if (event.startStr == dateStr) {
|
||||
// event.remove();
|
||||
// }
|
||||
// });
|
||||
// const selectedDatesInput = document.querySelector('#selected_dates');
|
||||
// selectedDatesInput.value = selectedDates.join(',');
|
||||
// selectedDatesInput.dispatchEvent(new Event('input'));
|
||||
|
||||
// } else {
|
||||
// selectedDates.push(dateStr);
|
||||
|
||||
// calendar.addEvent({
|
||||
// start: dateStr,
|
||||
// display: 'background',
|
||||
// color: '#f03f17'
|
||||
// });
|
||||
// }
|
||||
|
||||
// updateWorkingDays(info.date);
|
||||
// }
|
||||
// });
|
||||
|
||||
// yearSelect.addEventListener('change', function () {
|
||||
// let year = this.value;
|
||||
// if (!year) return;
|
||||
|
||||
// let currentDate = calendar.getDate();
|
||||
// let newDate = new Date(year, currentDate.getMonth(), 1);
|
||||
|
||||
// calendar.gotoDate(newDate);
|
||||
// });
|
||||
// }
|
||||
|
||||
function updateWorkingDays(date) {
|
||||
let totalDays = new Date(
|
||||
date.getFullYear(),
|
||||
date.getMonth()+1,
|
||||
date.getMonth() + 1,
|
||||
0
|
||||
).getDate();
|
||||
|
||||
let workingDays = totalDays - selectedDates.length;
|
||||
// document.querySelector('input[name="working_days"]').value = workingDays;
|
||||
|
||||
const input = document.querySelector('#working_days');
|
||||
|
||||
input.value = workingDays;
|
||||
|
||||
input.dispatchEvent(new Event('input'));
|
||||
|
||||
const monthInput = document.querySelector('#month');
|
||||
monthInput.value = date.getMonth() + 1; // 1–12 month number
|
||||
monthInput.dispatchEvent(new Event('input'));
|
||||
|
||||
const yearInput = document.querySelector('#year');
|
||||
yearInput.value = date.getFullYear();
|
||||
yearInput.dispatchEvent(new Event('input'));
|
||||
|
||||
const selectedDatesInput = document.querySelector('#selected_dates');
|
||||
selectedDatesInput.value = selectedDates.join(',');
|
||||
selectedDatesInput.dispatchEvent(new Event('input'));
|
||||
// Set values only
|
||||
document.querySelector('#working_days').value = workingDays;
|
||||
document.querySelector('#month').value = date.getMonth() + 1;
|
||||
document.querySelector('#year').value = date.getFullYear();
|
||||
document.querySelector('#selected_dates').value = selectedDates.join(',');
|
||||
|
||||
// Trigger only ONE update (important)
|
||||
document
|
||||
.querySelector('#selected_dates')
|
||||
.dispatchEvent(new Event('input'));
|
||||
}
|
||||
|
||||
|
||||
calendar.render();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user