How do I get Date Range Picker selected date to a variable?

manu p picture manu p · Feb 21, 2017 · Viewed 16.6k times · Source

hi i am using data range picker for filter option. there is change with default date picker range is . here i am using a div instead of text box. so tthat i need the selected start date and end date in a variable how can i due it?. i try like this way...

Answer

Murat Gündeş picture Murat Gündeş · Feb 21, 2017

Try this.

var startDate = $('#Date').data('daterangepicker').startDate._d;
var endDate = $('#Date').data('daterangepicker').endDate._d;