MTX_DATETIME_FORMATS not working
See original GitHub issueI want to customize the datetime input display, but it is not working, I copy the example from the docs.
providers: [
{
provide: MTX_DATETIME_FORMATS,
useValue: {
parse: {
dateInput: 'YYYY-MM-DD',
monthInput: 'MMMM',
timeInput: 'HH:mm',
datetimeInput: 'YYYY-MM-DD HH:mm',
},
display: {
dateInput: 'YYYY-MM-DD',
monthInput: 'MMMM',
timeInput: 'HH:mm',
datetimeInput: 'yyyy/MM/dd HH:mm:ss',
monthYearLabel: 'YYYY MMMM',
dateA11yLabel: 'LL',
monthYearA11yLabel: 'MMMM YYYY',
popupHeaderDateLabel: 'MMM DD, ddd',
},
},
},
],
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to change angular material datepicker format
this format. Please help me, I am unable to convert date in YYYY-MM-DD or YYYY-MM-DDTHH:mm format.
Read more >24 Working with dates and times - Stata
1. You begin with the datetime variables in your data however they are recorded, such as 21nov2006 or 11/21/2006 or November 21, 2006 ......
Read more >Date format in Grid | Angular - EJ 2 Forums - Syncfusion
there are another problem by doing it with format datetime. I want to show dateTime column by locale, but I am always get...
Read more >How to Fix Excel Dates That Won't Change Format - Contextures
Problem Excel Dates. If you import data into a Microsoft Excel spreadsheet, and try to format a column of dates, sometimes the dates...
Read more >Standard date and time format strings | Microsoft Learn
The "O" or "o" standard format specifier corresponds to the "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK" custom format string for DateTime values ...
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
I had the same error and after quite a bit of research it turns out that by adding
{ provide: DateAdapter, useClass: MomentDateAdapter }
it works as expected.I had to also install
@angular/material-moment-adapter
and@ng-matero/extensions-moment-adapter
to use the adapter.I followed @nzbin’s above link after installing these to make it work as I wanted.