ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
393 stars 48 forks source link

DateTime Picker dateFormat set from Input Decorator #201

Closed trmobile closed 1 year ago

trmobile commented 1 year ago

Hi, is there a possibility to set the date format via Input Decorator or dynamically from an API?

nzbin commented 1 year ago

I'm sorry, it only support change formats with MTX_DATETIME_FORMATS

providers: [
  {
    provide: MTX_DATETIME_FORMATS,
    useValue: {
      parse: {
        dateInput: 'YYYY-MM-DD',
        monthInput: 'MMMM',
        yearInput: 'YYYY',
        timeInput: 'HH:mm',
        datetimeInput: 'YYYY-MM-DD HH:mm',
      },
      display: {
        dateInput: 'YYYY-MM-DD',
        monthInput: 'MMMM',
        yearInput: 'YYYY',
        timeInput: 'HH:mm',
        datetimeInput: 'YYYY-MM-DD HH:mm',
        monthYearLabel: 'YYYY MMMM',
        dateA11yLabel: 'LL',
        monthYearA11yLabel: 'MMMM YYYY',
        popupHeaderDateLabel: 'MMM DD, ddd',
      },
    },
  },
]