Fix expirations

This commit is contained in:
jude 2023-08-10 18:25:41 +01:00
parent 0d4a02fb1e
commit 5a386daa9d

View File

@ -238,8 +238,11 @@ async function serialize_reminder(node, mode) {
utc_time = utc_time.toFormat("yyyy-LL-dd'T'HH:mm:ss");
}
let expiration = node.querySelector('input[name="expiration"]').value;
if (expiration) {
expiration_time = luxon.DateTime.fromISO(
node.querySelector('input[name="time"]').value
node.querySelector('input[name="expiration"]').value
).setZone("UTC");
if (expiration_time.invalid) {
return { error: "Expiration provided invalid." };
@ -247,6 +250,7 @@ async function serialize_reminder(node, mode) {
expiration_time = expiration_time.toFormat("yyyy-LL-dd'T'HH:mm:ss");
}
}
}
let name = node.querySelector('input[name="name"]').value;
if (name.length > 100) {
@ -429,7 +433,7 @@ function deserialize_reminder(reminder, frame, mode) {
timeInput.value = localTime.toFormat("yyyy-LL-dd'T'HH:mm:ss");
if (reminder["expires"]) {
let expiresInput = frame.querySelector('input[name="time"]');
let expiresInput = frame.querySelector('input[name="expiration"]');
let expiresTime = luxon.DateTime.fromISO(reminder["expires"], {
zone: "UTC",
}).setZone(timezone);