I have not used the bootstrap-datepicker before. When I saw the jquery example use $("..").datepicker( I just assumed this was also using jquery-ui. Of course I didn't initially read through every bit of the readme (my fault) but I was confused as bootstrap and jq-ui have a extremely similar pattern.
If you try to get Datepair with jquery-ui's datepicker, you get an unhelpful "empty object" error. I eventually realized that bootstrap had a different implementation for datepicker, and I needed to update the parseDate and updateDate methods.
So this is a suggestion to throw some example code like the following for jquery-ui into the readme.
$('#timePair').datepair({
parseDate: function (el) {
var utc = new Date($(el).datepicker('getDate'));
return utc && new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));
},
updateDate: function (el, v) {
$(el).datepicker('setDate', v);
}
});
I have not used the bootstrap-datepicker before. When I saw the jquery example use
$("..").datepicker(
I just assumed this was also using jquery-ui. Of course I didn't initially read through every bit of the readme (my fault) but I was confused as bootstrap and jq-ui have a extremely similar pattern.If you try to get Datepair with jquery-ui's datepicker, you get an unhelpful "empty object" error. I eventually realized that bootstrap had a different implementation for datepicker, and I needed to update the parseDate and updateDate methods.
So this is a suggestion to throw some example code like the following for jquery-ui into the readme.