Skip to main content


Showing posts with the label Angular Material Datepicker

Angular Material Datepicker,Angular Material Datepicker Custom Format,Datepicker Custom Format Moment.Js

 Customizing the parse and display formats of Material Datepicker using momentjs Code In Action @ StackBlitz Prerequisites  Create a new Angular Project refer Angular Step by Step Add Material For the Project refer Material for Angular  Dependencies  MomentJS Material-moment-adapter Add Dependencies  for Moment run the below command in Integrated Terminal npm i --save moment for Material-moment-adapter npm i --save @angular/material-moment-adapter TSConfig.JSON Add   "allowSyntheticDefaultImports": false in compiler options. Allow default imports from modules with no default export. This does not affect code emit, just typechecking. CustomDateFormat.ts Add a new file named CustomDateFormat.ts and copy the below code. import * as _moment from 'moment'; import {default as _rollupMoment} from 'moment'; import {MomentDateAdapter} from '@angular/material-moment-adapter'; export const moment = _