I want to read the data between the range as selected by user, but I am not able to get start and end date as selected. Although in console I am able to see it in moment, But don't know how can we get those dates and perform queries. Also get the dates in between selected range. For ex: below : should return betweendates = [7/11/19 , 8/11/19]
<input type="text" matInput
ngxDaterangepickerMd
[locale]="{applyLabel: 'ok', format: 'DD-MM-YYYY'}"
startKey="startDate"
endKey="endDate"
[(ngModel)]="selectedDaterange"
name="daterange"
(change)= 'selectDateRange()'
placeholder="choose date"/>
selectDateRange() {
console.log(moment().format());
console.log(this.selectedDaterange);
}
You can use the following to get the javascript
Date
objectCheck the following documentation for all the examples on how you can use moment
https://momentjs.com/docs/#/displaying/as-javascript-date/