From 4cab3932fa23dd14b375945a972cf4d01f6b53a8 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 09:19:26 +0100 Subject: [PATCH 1/3] added goToToday click handler for viewModel. this is to change the date on the picker control to todays date as the bootstrap datepicker control today button doesnt appear to be working. #83 --- .../WindowsDataCenter/www/spa.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js index b7629a1..ebdfd1a 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js @@ -52,6 +52,11 @@ } location.hash = url; }; + self.goToToday = function(a, b, c) { + self.goToTimeLogs(self.chosenTimeLogUserId, + null, + [{ key: "selectedDate", value: moment(new Date()).format("MM-DD-YYYY") }]); + }; self.assignErrorObject = function(errCode, errMessage, errorSource) { var errDat = { errorCode: errCode, @@ -176,9 +181,9 @@ } moment.locale("en", { week: { dow: 1 } }); $("#weeklyDatePicker").datetimepicker({ + //showTodayButton: true, format: "DD/MM/YYYY", inline: true, - showTodayButton: true, calendarWeeks: true, maxDate: "now", date: selectedDate @@ -369,12 +374,13 @@ ]); function editlog (data) { self.manualLog(data); - $('#manualLogDialog').modal("show"); - $('#datetimepicker1').datetimepicker({ + $("#manualLogDialog").modal("show"); + $("#datetimepicker1").datetimepicker({ format: "YYYY-DD-MM HH:mm:ss", date: new Date(data.EventTime), - minDate: moment(new Date(data.EventTime)).startOf('week'), - maxDate: moment(new Date(data.EventTime)).endOf('week') + sideBySide: true, + minDate: moment(new Date(data.EventTime)).startOf("week"), + maxDate: moment(new Date(data.EventTime)).endOf("week") }); self.assignUpdateHandler(); }; From 205d8e30dc73858521cccb0227633e2a8af703ec Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 09:20:56 +0100 Subject: [PATCH 2/3] refine the goToToday function. #83 --- .../WindowsDataCenter/WindowsDataCenter/www/spa.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js index ebdfd1a..fcd0081 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js @@ -52,10 +52,10 @@ } location.hash = url; }; - self.goToToday = function(a, b, c) { + self.goToToday = function() { self.goToTimeLogs(self.chosenTimeLogUserId, null, - [{ key: "selectedDate", value: moment(new Date()).format("MM-DD-YYYY") }]); + null); }; self.assignErrorObject = function(errCode, errMessage, errorSource) { var errDat = { From 67fc6a12aeafb6c5465334264b0bc21652af6cdb Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 09:21:48 +0100 Subject: [PATCH 3/3] add js script types. add manual Today button, databound to the goToToday method in viewmodel. #83 --- .../WindowsDataCenter/www/index.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html index 0b8e067..5e2353b 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html @@ -10,14 +10,14 @@ - + - - + + - +