Open Xab01 opened 10 years ago
I'm working on the same implementation. I think you have this error because the script expect a Date object. So you should try with something like :
self.birthDate = ko.observable(new Date("2014-01-10"));
You also have a mistake for options. In custom binding you use datetimepickerOptions and in your html you use datepickerOptions
self.birthDate = ko.observable(new Date("2014-01-10"));
is this suppose to set the initial value? (doesn't for me) hmm
@dyardyGIT to set the initial value you'd have to modify the binding:
instead of
if (widget) { widget.date = ko.utils.unwrapObservable(valueAccessor()); widget.setValue(); }
put
if (widget) { $(element).datepicker("update", ko.utils.unwrapObservable(valueAccessor())); }
yes ,I am solved
sorry to resurrect this one but i am having issue using knockout with this library. it works as long as the date is selected from the picker but getting strange behavior when entering the date into the textbox. anyone else having this issue?
I try to use bootstrap-datepicker with knockout:
this is my HTML code:
JS code
I have the error:
Do you have any idea?
Thanks in advance
Xavier