Currently, I have set up an ion-calendar utilizing the ion2-calendar plugin. The calendar is configured to disable dates prior to today's date. However, my goal is to also disable "today" and display available dates starting from tomorrow. Additionally, I only want the end date to be selectable within 3 months of the start date.
I attempted using [optionsRange] with 'from: new Date();' but this sets it as today's date. The [optionsRange] does work if I manually input the specific date values, but I am looking for a dynamic solution. https://www.npmjs.com/package/ion2-calendar
HTML CODE:
<ion-calendar [(ngModel)]="startDate"
[format]="'YYYY-MM-DD'"
[options]="optionsRange">
</ion-calendar>
TS FILE CODE:
optionsRange: CalendarComponentOptions = {
color: "primary",
from: new Date() + 1,
to: new Date() + 90
};
An error is thrown because the method cannot handle the '+' operator with a number.
My desired outcome is for from: ( Tomorrow's DATE ) and to: ( 3 months from the start Date ).