Closed corientdev closed 5 years ago
I may be having a similar problem: I have to click "apply" twice before the model actually gets updated.
Hope someone can offer a hint on how to fix this, "Click twice that model gets updated".
Hi, it may be my fault. It finally works if I change the code to this:
$scope.options = {
eventHandlers: {
'apply.daterangepicker': function (ev, picker) {
var start = picker.startDate.format('YYYY-MM-DD');
var end = picker.endDate.format('YYYY-MM-DD');
$scope.drawChartTable(start, end);
}
}
};
New date should be read from picker.
On a related note, I get undefined for the 'picker' parameter when i click Apply. 'ev' is there but i need 'picker' obviously for the values, what could I be doing?
angular-datepicker.js version: master datepicker.js version: 2.1.13
Any word on this...just opened an issue on picker being undefined. You are able to get to the values through ev.model.startDate and ev.model.endDate, however I'm trying to get the selected range parameter. For instance if a user selects the range "Yesterday" I want to know that
I haven't made any discovories yet. Something in the angular code I suspect. I double checked the daterangerpicker.js listener and it sees the picker object.
@Vimos can you provide your actual implementation of the picker? As in, is it using an or different tag, ie.
I think this issue can be closed in favor of https://github.com/fragaria/angular-daterangepicker/issues/119 See also my latest comment in there.
Struggling to get the selected start date and end date in controller after apply.daterangepicker event