Can not format textField of type date in the form 'DD/MM/YYYY'
See original GitHub issueCan not format textField of type date in the form ‘DD/MM/YYYY’. The options for type are limited. Why not have a format field
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
TextField should have a format prop that will help format date in any format. eg.
<TextField
onChange={onDateChange}
id="date"
label="Date Received"
type="date"
format={'DD/MM/YYYY'}
value={dateRecieved}
className={classes.textField}
margin="normal"
InputLabelProps={{
shrink: true
}}
/>
Current Behavior
Currently the type options doesn’t allow to format in DD/MM/YYYY
form.
Your Environment
Tech | Version |
---|---|
Material-UI | 1.0.0-beta.32 |
React | 3.7.2 |
browser | chrome |
etc |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:17
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Can not format textField of type date in the form 'DD/MM/YYYY'
TextField should have a format prop that will help format date in any format. eg. <TextField onChange={onDateChange} id="date" label="Date ...
Read more >Is there any way to change input type="date" format?
Users can type a date value into the text field of an input[type=date] with the date format shown in the box as gray...
Read more ><input type="date"> - HTML: HyperText Markup Language
This code finds the first <input> element whose type is date , and sets its value to 2017-06-01 (June 1st, 2017).
Read more >How to set input type date in dd-mm-yyyy format using HTML
To set and get the input type date in dd-mm-yyyy format we will use <input> type attribute. The <input> type attribute is used...
Read more >Error transforming dd.mm.yyyy text field to date
I made a typo in the description, the date is DD.MM.YYYY format as stated in the subject. In any case, I am surprised...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yuvraj88 You have two options:
inputComponent
prop with the native implementation. It would probably only work well on mobile.https://codesandbox.io/s/zq89ym8v74
Its strange… it takes the local machine’s date time format.