Skip to content

ion-datetime issues with properties: min max displayFormat pickerFormat  #8729

@ecureuill

Description

@ecureuill

Short description of the problem:

Add displayFormat or pickerFormat attribute led to:

  1. miss day column in picker and don't fill the day in display.
  2. if pickerFormat is YYYY and displayFormat is not defined, display value show ,YYYY

Add max attribute with a date less than current date lead to

  1. Miss month & year column in picker if max attr value less then (current date - 101)
  2. Miss month column in picker if max attr value less then current date & greater then (current date - 100)After scroll in picker or select a date, missed column appear.

Add min attribute lead to:

  1. Miss month & year column in picker if min attr value greater then current year
  2. Miss month column in picker if min attr value is today, yesterday or tomorrow. After scroll in picker or select a date, missed column appear.

What behavior are you expecting?

  1. Set any valid format to displayFormat or pickerFormat must not break the component
  2. If pickerFormat is defined and displayFormat is not defined, displayFormat should be set to same format as pickerFormat
  3. If max attr value is defined, min attr value is not defined and max attr value is less then default minimum value (current date - 100 years), then min value should be set to the year of defined max value attr to avoid issues
  4. If in attr value is defined, max attr value is not defined and in attr value is greater then default maximum value (current year), then max value should be set to the year of defined min value attr to avoid issues

Other information:
Tested in chrome

Which Ionic Version? 1.x or 2.x
2 RC1

Plunker that shows an example of your issue

http://embed.plnkr.co/MjdZ0n/

Run ionic info from terminal/cmd prompt: (paste output below)

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Debian Description: Debian GNU/Linux 8.6 (jessie)
Node Version: v6.6.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions