hsuanxyz / ion2-calendar

📅 A date picker components for ionic2 /ionic3 / ionic4
https://hsuanxyz.github.io/demo/ion2-calendar/
MIT License
555 stars 278 forks source link

Setup days minimum on range #196

Open donpedro0914 opened 6 years ago

donpedro0914 commented 6 years ago

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

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

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

Other information: How to set the date minimum days range 3 days minimum

for example From: 08-01-2018 to: 08-03-2018

they cant select 08-02-2018 because of the minimum.

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

Ionic:

   ionic (Ionic CLI)  : 4.1.0 (C:\Users\peter\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.11

Cordova:

   cordova (Cordova CLI) : 7.1.0
   Cordova Platforms     : not available
   Cordova Plugins       : not available

System:

   NodeJS : v8.9.1 (C:\laragon\bin\nodejs\node-v8\node.exe)
   npm    : 6.3.0
   OS     : Windows 10

Environment:

   ANDROID_HOME : not set
kustrun commented 6 years ago

Use event listeners (onSelectStart, onSelectEnd), manually calcualte difference and display error if difference is less than you want: https://github.com/HsuanXyz/ion2-calendar#output-properties.

lordcoste commented 4 years ago

How can you set event listeners in modal mode?