From 28d376a394c88e9c56a984dde7a2d82f268b6850 Mon Sep 17 00:00:00 2001 From: ankurjuneja Date: Fri, 9 Jan 2026 21:10:59 -0800 Subject: [PATCH 1/3] Handle timezone correctly during saving qc annotation --- webapp/TargetedMS/js/QCTrendPlotPanel.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/webapp/TargetedMS/js/QCTrendPlotPanel.js b/webapp/TargetedMS/js/QCTrendPlotPanel.js index 51e41b383..66d91eb13 100644 --- a/webapp/TargetedMS/js/QCTrendPlotPanel.js +++ b/webapp/TargetedMS/js/QCTrendPlotPanel.js @@ -1972,7 +1972,9 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', { }, openAnnotationDialog: function (addNew, data) { - const date = this.formatDate(new Date(data['Date']), false); + // Parse date as UTC to avoid timezone conversion issues + const dateStr = this.formatDate(new Date(data['Date']), false); + const date = new Date(dateStr + 'T00:00:00Z'); const title = addNew ? 'Add Annotation' : 'Edit Annotation'; const me = this; @@ -2019,7 +2021,8 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', { name: 'annotationDate', format: 'Y-m-d', allowBlank: false, - value: date + value: date, + submitFormat: 'Y-m-d' }], buttons: [{ @@ -2081,13 +2084,16 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', { }, saveAnnotation: function (annotationType, description, annotationDate, win) { + // Format date as UTC string (YYYY-MM-DD) to avoid timezone conversion + const dateStr = Ext4.util.Format.date(annotationDate, 'Y-m-d'); + LABKEY.Query.insertRows({ schemaName: 'targetedms', queryName: 'QCAnnotation', rows: [{ QCAnnotationTypeId: annotationType, Description: description, - Date: annotationDate + Date: dateStr }], success: function () { win.close(); @@ -2109,6 +2115,9 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', { }, updateAnnotation: function (annotationId, annotationType, description, annotationDate, win) { + // Format date as UTC string (YYYY-MM-DD) to avoid timezone conversion + const dateStr = Ext4.util.Format.date(annotationDate, 'Y-m-d'); + LABKEY.Query.updateRows({ schemaName: 'targetedms', queryName: 'QCAnnotation', @@ -2116,7 +2125,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', { Id: annotationId, QCAnnotationTypeId: annotationType, Description: description, - Date: annotationDate + Date: dateStr }], success: function () { win.close(); From 0d70a9d6f9dec80f2ef45c4f8bf187041c6cbd4d Mon Sep 17 00:00:00 2001 From: ankurjuneja Date: Mon, 12 Jan 2026 12:05:33 -0800 Subject: [PATCH 2/3] try this change --- webapp/TargetedMS/js/QCTrendPlotPanel.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webapp/TargetedMS/js/QCTrendPlotPanel.js b/webapp/TargetedMS/js/QCTrendPlotPanel.js index 66d91eb13..a895a382c 100644 --- a/webapp/TargetedMS/js/QCTrendPlotPanel.js +++ b/webapp/TargetedMS/js/QCTrendPlotPanel.js @@ -1972,9 +1972,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', { }, openAnnotationDialog: function (addNew, data) { - // Parse date as UTC to avoid timezone conversion issues - const dateStr = this.formatDate(new Date(data['Date']), false); - const date = new Date(dateStr + 'T00:00:00Z'); + const date = this.formatDate(new Date(data['Date']), false); const title = addNew ? 'Add Annotation' : 'Edit Annotation'; const me = this; From 889a3dbce687d0f18f11538761b1cd7bacd18691 Mon Sep 17 00:00:00 2001 From: ankurjuneja Date: Tue, 13 Jan 2026 12:40:19 -0800 Subject: [PATCH 3/3] try this --- webapp/TargetedMS/js/QCTrendPlotPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/TargetedMS/js/QCTrendPlotPanel.js b/webapp/TargetedMS/js/QCTrendPlotPanel.js index a895a382c..2b2756ba1 100644 --- a/webapp/TargetedMS/js/QCTrendPlotPanel.js +++ b/webapp/TargetedMS/js/QCTrendPlotPanel.js @@ -1972,7 +1972,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', { }, openAnnotationDialog: function (addNew, data) { - const date = this.formatDate(new Date(data['Date']), false); + const date = this.formatDate(data['Date'], false); const title = addNew ? 'Add Annotation' : 'Edit Annotation'; const me = this;