angularangular-materialangular-material-datetimepicker

Angular Material DatePicker Custom Format Example


I'm looking at this StackBlitz here:

https://stackblitz.com/edit/y7p87g?file=src%2Fexample%2Fdatepicker-formats-example.html,src%2Fexample%2Fdatepicker-formats-example.ts

And I'm wondering how to format the date that displays in the collapsed control (underneath "Verbose datepicker" to something like 25-Dec-2023, instead of December 25, 2023. I've tried tweaking those display options to no avail.

The API documentation doesn't seem to say what options are available for this.

Thanks in advance!


Solution

  • I think you need to change dateInput from LL to dateInput: 'DD-MMM-YYYY', or to some other date formats which you need