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
This commit is contained in:
chris.watts90@outlook.com 2017-04-21 09:19:26 +01:00
parent 76ac93493d
commit 4cab3932fa

View File

@ -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();
};