My javascript below using preset ranges for DateRangePicker - I need to pass the selected start and end dates to two variables call StartDate and EndDate or pass it back to my LogiXML input text box. I am not sure how to do this. Please help.
Note: I don't want to run the daterangepicker logic for two different input fields(from and to). I want to use one input field but the start and end dates are passed to two separate variables.
I am using comiseo.daterangepicker please help me.
$(document).ready(function() {
$("#inpDatePicker").daterangepicker({
presetRanges: [{
text: 'Today',
dateStart: function() { return moment() },
dateEnd: function() { return moment() }
}, {
text: 'Month to Date',
dateStart: function() { return moment().startOf('month') },
dateEnd: function() { return moment() }
}, {
text: 'Quarter to Date',
dateStart: function() { return moment().startOf('quarter') },
dateEnd: function() { return moment() }
}, {
text: 'Year to Date',
dateStart: function() { return moment().startOf('Year') },
dateEnd: function() { return moment() }
}],
applyOnMenuSelect: true,
datepickerOptions: {
minDate: 0,
maxDate: null,
numberOfMonths : 3,
changeMonth: true,
changeYear: true
}
})
});