consolidate code for datetime picker to ensure consistency in setup for create/edit dialogs.
This commit is contained in:
parent
5e86dae944
commit
c45716e796
@ -375,16 +375,10 @@
|
|||||||
function editlog (data) {
|
function editlog (data) {
|
||||||
self.manualLog(data);
|
self.manualLog(data);
|
||||||
$("#manualLogDialog").modal("show");
|
$("#manualLogDialog").modal("show");
|
||||||
$("#datetimepicker1").datetimepicker({
|
self.initialiseManualLogDateTimePicker(data.EventTime);
|
||||||
format: "YYYY-DD-MM HH:mm:ss",
|
|
||||||
date: new Date(data.EventTime),
|
|
||||||
sideBySide: true,
|
|
||||||
minDate: moment(new Date(data.EventTime)).startOf("week"),
|
|
||||||
maxDate: moment(new Date(data.EventTime)).endOf("week")
|
|
||||||
});
|
|
||||||
self.assignUpdateHandler();
|
self.assignUpdateHandler();
|
||||||
};
|
};
|
||||||
function createlog(data) {
|
function createlog(data, event) {
|
||||||
self.manualLog({
|
self.manualLog({
|
||||||
CalendarWeek:-1,
|
CalendarWeek:-1,
|
||||||
Direction:-1,
|
Direction:-1,
|
||||||
@ -395,11 +389,7 @@
|
|||||||
Year: 0
|
Year: 0
|
||||||
});
|
});
|
||||||
$('#manualLogDialog').modal("show");
|
$('#manualLogDialog').modal("show");
|
||||||
$('#datetimepicker1').datetimepicker({
|
self.initialiseManualLogDateTimePicker(self.selectedTimeLogDate());
|
||||||
format: "YYYY-DD-MM HH:mm:ss",
|
|
||||||
minDate: moment(self.selectedTimeLogDate()).startOf("week"),
|
|
||||||
maxDate: moment(self.selectedTimeLogDate()).endOf("week")
|
|
||||||
});
|
|
||||||
self.assignUpdateHandler();
|
self.assignUpdateHandler();
|
||||||
};
|
};
|
||||||
function deleteLog(data) {
|
function deleteLog(data) {
|
||||||
@ -407,6 +397,16 @@
|
|||||||
self.deleteManualLog(data);
|
self.deleteManualLog(data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
self.initialiseManualLogDateTimePicker = function (date) {
|
||||||
|
$('#datetimepicker1')
|
||||||
|
.datetimepicker({
|
||||||
|
format: "YYYY-DD-MM HH:mm:ss",
|
||||||
|
date: new Date(date),
|
||||||
|
sideBySide:true,
|
||||||
|
minDate: moment(date).startOf("week"),
|
||||||
|
maxDate: moment(date).endOf("week")
|
||||||
|
});
|
||||||
|
};
|
||||||
Sammy(function () {
|
Sammy(function () {
|
||||||
this.get("#users", function () {
|
this.get("#users", function () {
|
||||||
var query = this.params.query;
|
var query = this.params.query;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user