This commit is contained in:
@@ -1047,18 +1047,23 @@ async function handleEnhancedEditSubmit(event) {
|
||||
const dateadded = document.getElementById('edit-dateadded').value;
|
||||
const source = document.getElementById('edit-source').value;
|
||||
|
||||
if (!dateadded) {
|
||||
if (!dateadded && source !== 'airdate') {
|
||||
showToast('Please enter a date', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert datetime-local to ISO string with error handling
|
||||
let isoDateadded = null;
|
||||
try {
|
||||
isoDateadded = new Date(dateadded).toISOString();
|
||||
} catch (e) {
|
||||
showToast('Invalid date format', 'error');
|
||||
return;
|
||||
if (dateadded) {
|
||||
try {
|
||||
isoDateadded = new Date(dateadded).toISOString();
|
||||
} catch (e) {
|
||||
showToast('Invalid date format', 'error');
|
||||
return;
|
||||
}
|
||||
} else if (source === 'airdate') {
|
||||
// For airdate source, let the backend handle the date conversion
|
||||
isoDateadded = null;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user