I\'ve recently ported my company\'s project to Durandal using Knockout and JQuery. Straight to the problem: I need to initialize JQuery UI\'s datepicker using two HTML inputs. J
Pretty sure the problem is with this:
users.SelectUser = function (user) {
servers.CurrentUser(user);
/* ... */
$(function () {
$("#datepickerFrom").datetimepicker({
dateFormat: "d. m. yy",
timeFormat: "HH:mm:ss",
defaultDate: null
});
$("#datepickerTo").datetimepicker({
dateFormat: "d. m. yy",
timeFormat: "HH:mm:ss"
});
});
}
You have your jQuery datepicker init code inside a function. That means that it will only run when the SelectUser
function gets called. Try moving that outside of any functions.