tamble / jquery-ui-daterangepicker

A JQuery UI based date range picker.
MIT License
184 stars 108 forks source link

Binding dateRangePicker with a knockoutjs viewModel #23

Closed harsh-vardhhan closed 9 years ago

harsh-vardhhan commented 9 years ago

Not able to make dateRangePicker read an observable in knockout. I am trying to assign a single date to dateRangePicker http://jsfiddle.net/harsh611/jtj7kemj/12/

ghola commented 9 years ago

Are you able to assign a single date to a dateRangePicker outside of an observable?

harsh-vardhhan commented 9 years ago

only using preset ranges but not by just using ranges{start:somedate,end:somedate}

ghola commented 9 years ago

You can't use setDate, because such a method is not implemented. You can use setRange though. Take a look at the docs to see how to use it (Programmatic Control section).

harsh-vardhhan commented 9 years ago

http://jsfiddle.net/jtj7kemj/13/

harsh-vardhhan commented 9 years ago

what am I doing wrong here?

ghola commented 9 years ago

See this: http://jsfiddle.net/bo7msbnq/1/

harsh-vardhhan commented 9 years ago

thanks a million for such great support

harsh-vardhhan commented 9 years ago

http://stackoverflow.com/questions/31288770/knockout-databind-with-jqueryui-based-daterangepicker/31318131#31318131 This is the way to write custom knockoutjs binder for dateRangePicker, in case it helps some one in the future