From f90fdf2588d1193f9af178a0c6a8207a30a8efc5 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Mon, 2 Nov 2026 08:23:55 -0500 Subject: [PATCH] Fix queue panel bugs caused by newer browsers not respecting valueAsDate for 'datetime-local' inputs --- .../channel/panels/queuePanel/queuePanel.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/www/js/channel/panels/queuePanel/queuePanel.js b/www/js/channel/panels/queuePanel/queuePanel.js index 436f26f..13eae86 100644 --- a/www/js/channel/panels/queuePanel/queuePanel.js +++ b/www/js/channel/panels/queuePanel/queuePanel.js @@ -1716,7 +1716,7 @@ class schedulePopup{ //Zero out time to the nearest minute curDate.setSeconds(0,0); //Set the date prompt to the next minute, adjusted to display local time - this.datePrompt.valueAsDate = utils.ux.localizeDate(curDate); + this.datePrompt.valueAsNumber = utils.ux.localizeDate(curDate).getTime(); //Setup input this.setupInput(); @@ -1745,7 +1745,7 @@ class schedulePopup{ //If we clicked or hit enter if(event.key == null || event.key == "Enter"){ //Get localized input date - const inputDate = utils.ux.normalizeDate(this.datePrompt.valueAsDate); + const inputDate = utils.ux.normalizeDate(new Date(this.datePrompt.valueAsNumber)); //Tell the server to move the media this.client.socket.emit("queue",{url: this.url, title: this.title, start: inputDate.getTime()}); @@ -1783,7 +1783,7 @@ class reschedulePopup extends schedulePopup{ //If we clicked or hit enter if(event.key == null || event.key == "Enter"){ //Get localized input date - const inputDate = utils.ux.normalizeDate(this.datePrompt.valueAsDate); + const inputDate = utils.ux.normalizeDate(new Date(this.datePrompt.valueAsNumber)); //Tell the server to move the media this.client.socket.emit('move', {uuid: this.media.uuid, start: inputDate.getTime()}); @@ -1827,7 +1827,7 @@ class clearPopup{ /** * Continuation of object construction, called after child popup object construction */ - asyncConstructor(){ + async asyncConstructor(){ //Grab required UI elements this.clearButton = this.popup.contentDiv.querySelector('#clear-media-popup-clear-button'); this.startDatePrompt = this.popup.contentDiv.querySelector('#clear-media-popup-start-time-prompt'); @@ -1838,11 +1838,14 @@ class clearPopup{ //Zero out current time to the nearest minute curDate.setSeconds(0,0); //Set the start date prompt to the next minute, adjusted to display local time - this.startDatePrompt.valueAsDate = utils.ux.localizeDate(curDate); + //For whatever reason firefox fucking hates me for accessing valueAsDate from popups now + //Not sure why, this used to work fine + //Waitin for DOM to load don't fix it, trust me i've waited for literally seconds worth if render frames and still nuttin' + this.startDatePrompt.valueAsNumber = utils.ux.localizeDate(curDate).getTime(); //Add 30 minutes curDate.setMinutes(curDate.getMinutes() + 30); //Set the end date prompt to 30 minutes in the futre, adjusted to display local time - this.endDatePrompt.valueAsDate = utils.ux.localizeDate(curDate); + this.endDatePrompt.valueAsNumber = utils.ux.localizeDate(curDate).getTime(); //Setup input this.setupInput(); @@ -1871,8 +1874,8 @@ class clearPopup{ //If we clicked or hit enter if(event.key == null || event.key == "Enter"){ //Get localized input date - const inputStartDate = utils.ux.normalizeDate(this.startDatePrompt.valueAsDate); - const inputEndDate = utils.ux.normalizeDate(this.endDatePrompt.valueAsDate); + const inputStartDate = utils.ux.normalizeDate(new Date(this.startDatePrompt.valueAsNumber)); + const inputEndDate = utils.ux.normalizeDate(new Date(this.endDatePrompt.valueAsNumber)); //Tell the server to clear media between the input range this.client.socket.emit("clear",{start: inputStartDate.getTime(), end: inputEndDate.getTime()});