ionic-framework: bug(datetime) - Datetime now returns an object, instead of an ISO string
Ionic version: (check one with “x”) [ ] 1.x [ ] 2.x [x] 3.x
I’m submitting a … (check one with “x”) [x] bug report [ ] feature request [ ] support request
Current behavior: Selecting a date with the datetime and clicking ‘OK’ returns an object to the model instead of an ISO string. According to the docs I should be receiving an ISO string: DateTime Docs
Expected behavior: I expect the datetime to return an ISO string as it did in ionic 2
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1-201704062237
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.0
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.10.1
Xcode version: Xcode 8.3.1 Build version 8E1000a
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 18 (6 by maintainers)
I agree with @growthclick
I use datetime with formControlName and this saved me:
Any update on this please? I first reported this bug on 7th of April. Thanks
On Wed, Apr 26, 2017 at 11:21 PM, Leonardo Ruhland <notifications@github.com
Thanks for the workaround. That might work well with single binding on [ngModel]. I retested with the component inside a form and with correct names but still had the same results.
It looks like the object may be getting passed back in the onChange function without the convertDataToISO() call that is on line 836.
https://github.com/driftyco/ionic/blob/24544e01e150bf59bfc8a6d1cc38b7cdae860c4f/src/components/datetime/datetime.ts#L850
https://github.com/driftyco/ionic/blob/24544e01e150bf59bfc8a6d1cc38b7cdae860c4f/src/components/datetime/datetime.ts#L836