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

ion-datetime with no value set shows the first January of the current year when opened #17481

Closed
ryaa opened this issue Feb 13, 2019 · 3 comments
Labels

Comments

@ryaa
Copy link

ryaa commented Feb 13, 2019

Bug Report

Ionic version:

[x] 4.x

Current behavior:

ion-datetime control within a reactive form with no value set shows 1st of January 2019 (current year) when opened

Expected behavior:

It should default to the current date (this is how it works in Ionic 3)

Steps to reproduce:

See below

Related code:
Here is ion-datetime control inside a reactive form
<ion-datetime formControlName="<FIELD_NAME>" pickerFormat="MM/DD/YYYY" displayFormat="DDD, D MMM YYYY"></ion-datetime>
Please note that the control is set to null in the reactive form

StackBlitz (https://stackblitz.com)
Not possible due to this bug #16354

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.5.0 (/Users/alexryltsov/.nvm/versions/node/v10.14.2/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.1
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.2.3

Capacitor:

   capacitor (Capacitor CLI) : 1.0.0-beta.17
   @capacitor/core           : 1.0.0-beta.17

Cordova:

   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (5 plugins total)

System:

   Android SDK Tools : 26.1.1 (/Users/alexryltsov/Library/Android/sdk/)
   NodeJS            : v10.14.2 (/Users/alexryltsov/.nvm/versions/node/v10.14.2/bin/node)
   npm               : 6.5.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.1 Build version 10B61
@ionitron-bot ionitron-bot bot added the triage label Feb 13, 2019
@ryaa
Copy link
Author

ryaa commented Feb 13, 2019

This bug could be related to #16436 and #15792 and #9846

@liamdebeasi
Copy link
Contributor

Hi there,

Thanks for opening an issue with us! I currently have a PR open that will fix this: #17443

Hoping to get this merged in soon.

Thanks for using Ionic!

@ionitron-bot
Copy link

ionitron-bot bot commented Mar 15, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Mar 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants