Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular datepicker sending value one day less than

npm i moment
npm i @angular/material-moment-adapter
in app.ts import : 
import { MatMomentDateModule, MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/material-moment-adapter';
now add this line in providers, { useUtc: true }  :
providers: [
    { provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: true } }
  ],
 
PREVIOUS NEXT
Tagged: #angular #datepicker #sending #day
ADD COMMENT
Topic
Name
9+9 =