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
This commit is contained in:
chris.watts90@outlook.com 2020-02-24 14:34:41 +00:00
parent 5b10b5d546
commit 8d7eceb7f7

View File

@ -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) {