From 8d7eceb7f7a5afe3a533dd9f28319e4c95429de8 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Mon, 24 Feb 2020 14:34:41 +0000 Subject: [PATCH] Found that the createLog context menu passes in the row context to the method, but with basic info e.g.: "day: 2, dayOfWeek:'tuesday'" etc. Now use this "day:2" to add to the selected timelog date interval (the date of the monday of the selected week). To now calculate the period. This is then used to update the log date picker when manually creating a log. #82 --- .../WindowsDataCenter/WindowsDataCenter/www/spa.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js index 9d04fba..1117178 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js @@ -156,7 +156,7 @@ var args = [ { key: "groupId", - value: data + value: datacreateContextMenu } ]; var url = self.helpers.createRequestUrl("users", args, false, false); @@ -396,17 +396,18 @@ self.assignUpdateHandler(); }; function createlog(data, event) { + var logDateInitVal = moment(self.selectedTimeLogDate()).add((data.Day - 1), 'days').toISOString(); self.manualLog({ CalendarWeek:-1, Direction:-1, - EventTime: new Date().toISOString(), + EventTime: logDateInitVal, Id: -1, IdentifierId: -1, UserId: self.chosenTimeLogUserId, Year: 0 }); $('#manualLogDialog').modal("show"); - self.initialiseManualLogDateTimePicker(self.selectedTimeLogDate()); + self.initialiseManualLogDateTimePicker(logDateInitVal); self.assignUpdateHandler(); }; function deleteLog(data) {