Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to select dates earlier than the current date. #331

Open
806software opened this issue Jun 29, 2021 · 1 comment
Open

Unable to select dates earlier than the current date. #331

806software opened this issue Jun 29, 2021 · 1 comment

Comments

@806software
Copy link

806software commented Jun 29, 2021

Ionic version: (check one with "x")
[ ] 2.x
[ ] 3.x
[ ] 4.x
[x] 5.x

Ion2-calendar mode: (check one with "x")
[ ] components mode
[x ] modal mode

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] help me

Current behavior:

Configuring a modal I am unable to select any date before the current date.

Expected behavior:

I should be able to select dates earlier than the current date

Steps to reproduce:

Create a modal and present. Dates before the current date are greyed out and not selectable. Cannot move backwards.
I have tried setting the to, from and defaultDate options, but none have any impact - hence omitting them below as it gives the same result.

Related code:

const options: CalendarModalOptions = {
      title: 'Select date',
      color: 'primary',
      pickMode: 'single',
      closeIcon: false,
      closeLabel: '',
      doneLabel: 'Set date',
};

const modal = await this.modalController.create({
      component: CalendarModal,
      componentProps: options
 });

await modal.present();

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Ionic:

   Ionic CLI                     : 6.16.1 (/Users/jasonmcclean/n_local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.6.7
   @angular-devkit/build-angular : 12.0.1
   @angular-devkit/schematics    : 12.0.1
   @angular/cli                  : 12.0.1
   @ionic/angular-toolkit        : 4.0.0

Utility:

   cordova-res : not installed globally
   native-run  : not installed globally

System:

   NodeJS : v14.17.0 (/Users/jasonmcclean/n_local/bin/node)
   npm    : 6.14.13
   OS     : macOS Big Sur

As can be seen below, everything before the current date (29th June 2021), is not selectable. I have used this component on several projects (prior to Ionic 5), with no issues.

ion2-calendar

@806software
Copy link
Author

I've worked around it by creating a separate modal and using the calendar component within that modal instead. That appears to work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant