This commit is contained in:
1 parent
eb66af837f
commit
4516a80208
3 files changed
+15
-9
No files matched your search
@@ -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