Open prakashbarik90 opened 4 years ago
Ionic version: (check one with "x") [ ] 3.x
Ion2-calendar mode: (check one with "x") [ ] components mode [ ] modal mode
I'm submitting a ... (check one with "x") [ ] bug report
Current behavior: My HTML Code:
<ion-calendar [(ngModel)]="dateRange" [options]="optionsRange" [type]="'string'" [format]="'YYYY-MM-DD'" (onChange)="selectedRangeDates($event)" (onSelectStart)="onSelectStart($event)" (onSelectEnd)="onSelectEnd($event)" > </ion-calendar>
TS Code:
optionsRange: CalendarComponentOptions = { pickMode: 'range' }; selectedRangeDates(dates) { console.log(JSON.parse(JSON.stringify(dates)); } onSelectStart(dates) { console.log("onSelectStart DATES :: " + JSON.stringify(dates)); }
OUTPUT:
onSelectStart DATES ::{"time":1595442600000,"isToday":false,"title":"23","subTitle":"","selected":true,"isLastMonth":false,"isNextMonth":false,"marked":false,"cssClass":"","disable":false,"isFirst":false,"isLast":false}
On the above output i am getting “23” as selected date but instead of 23 i want to get YYYY-MM-DD when on click a single date as start date and dynamically set next 30 days in calendar from the selected date.
Ionic version: (check one with "x") [ ] 3.x
Ion2-calendar mode: (check one with "x") [ ] components mode [ ] modal mode
I'm submitting a ... (check one with "x") [ ] bug report
Current behavior: My HTML Code:
TS Code:
OUTPUT:
onSelectStart DATES ::{"time":1595442600000,"isToday":false,"title":"23","subTitle":"","selected":true,"isLastMonth":false,"isNextMonth":false,"marked":false,"cssClass":"","disable":false,"isFirst":false,"isLast":false}
On the above output i am getting “23” as selected date but instead of 23 i want to get YYYY-MM-DD when on click a single date as start date and dynamically set next 30 days in calendar from the selected date.