When using mbsc-calendar with ionic as a directive, set readonly property to true will not prevent the calendar to popup, and the calendar is selectabe.
I tried:
<ion-input mbsc-calendar [readonly]="true"></ion-input>
or
<ion-input mbsc-calendar [readOnly]="true"></ion-input>
and
<ion-input mbsc-calendar [mbsc-options]="settings"></ion-input>
const settings:MbscCalendarOptions = {readOnly: true}
or
const settings:MbscCalendarOptions = {readonly: true}
The problem is that the “readonly” settings is missing from the Calendar types.
You can still use it inside the settings, but you will need to declare it as any
, also, make sure you declare the settings inside your component (you cannot do that using const
):
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
settings: any = {
readonly: true
};
}
However, please note that the readonly
setting will not prevent opening the calendar, only it won’t let picking a value. To prevent the opening as well, you can use the disabled
option.