Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions webapp/TargetedMS/js/QCTrendPlotPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -2019,7 +2019,8 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
name: 'annotationDate',
format: 'Y-m-d',
allowBlank: false,
value: date
value: date,
submitFormat: 'Y-m-d'
}],

buttons: [{
Expand Down Expand Up @@ -2081,13 +2082,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();
Expand All @@ -2109,14 +2113,17 @@ 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',
rows: [{
Id: annotationId,
QCAnnotationTypeId: annotationType,
Description: description,
Date: annotationDate
Date: dateStr
}],
success: function () {
win.close();
Expand Down