Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(datetime): display today's date and time when value is an empty s…
…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 <[email protected]>
- Loading branch information