mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-18 22:28:38 -05:00
driver: add support for date inputs
This commit is contained in:
@@ -190,6 +190,10 @@ cy.get("body").type("{uparrow}{uparrow}{downarrow}{downarrow}{leftarrow}{rightar
|
||||
cy.get("body").type("{shift}", {release: false}).get("li:first").click()
|
||||
```
|
||||
|
||||
# Date inputs
|
||||
|
||||
Using `cy.type()` on a date input (`<input type="date">`) requires specifying a valid date in the format `yyyy-MM-dd`, e.g. `"1999-12-31"`. This isn't exactly how a user would type into a date input, but is a workaround since date input support varies between browsers and the format varies based on locale. `yyyy-MM-dd` is the format required by [the W3 spec](https://www.w3.org/TR/html5/forms.html#date-state-(type=date)) and is what the input's `value` will be set to regardless of browser or locale.
|
||||
|
||||
# Known Issues
|
||||
|
||||
## Native `input[type=date,datetime,datetime-local,month,year,color]`
|
||||
|
||||
Reference in New Issue
Block a user