You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…tring (#29839)
Issue number: resolves#29669
---------
## What is the current behavior?
Setting `value` to an empty string on `<ion-datetime>` renders a May
2021 calendar:
```html
<ion-datetime value=""></ion-datetime>
```
## What is the new behavior?
Show the month and time for today's date when value is an empty string.
This matches how a native `input` with `type="datetime-local"` works.
## Does this introduce a breaking change?
- [ ] Yes
- [x] No
## Other information
This can be tested by removing my fix in `datetime.tsx` and running the
e2e test for Datetime:
```bash
npm run test.e2e src/components/datetime/test/basic/datetime.e2e.ts
```
The `should display today's date and time when value is an empty string`
test should fail.
Alternatively, you can add a datetime with `value=""` and see the
calendar before & after my fix.
---------
Co-authored-by: Tanner Reits <47483144+tanner-reits@users.noreply.github.com>
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.
Prerequisites
Ionic Framework Version
v8.x
Current Behavior
Using Ionic/Vue 8.2.3,
when
src.txt
is an empty string, the default date is "May 2021", no day selected.Expected Behavior
I would recommend, to set the default month, year to the actual date (in the moment like "June 2024").
Steps to Reproduce
Open an
ion-datetime
control with an empty string as value.Code Reproduction URL
https://stackblitz.com/edit/lhlzcu?file=src%2Fcomponents%2FExample.vue
Ionic Info
Ionic:
Ionic CLI : 7.2.0 (C:\Users\Marco\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/vue 8.2.3
Capacitor:
Capacitor CLI : 6.1.0
@capacitor/android : not installed
@capacitor/core : 6.1.0
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 2.0.1
System:
NodeJS : v20.11.0 (D:\nodejs\node.exe)
npm : 10.8.1
OS : Windows 10
Additional Information
No response
The text was updated successfully, but these errors were encountered: