day incorrect in angular material datepicker

后端 未结 15 1855
挽巷
挽巷 2020-12-08 11:01

When I select a date I see the correct date in the field but, when I save, the datepicker send the day before the date I have selected ( 3 hours offset ) i am using angular

15条回答
  •  时光取名叫无心
    2020-12-08 11:19

    thanks to @ankit-raonka answer here : https://stackoverflow.com/a/48761312/6423656

    using ControlValueAccessor solved my issue and here is a working example : https://stackblitz.com/edit/angular-dlxnmx?file=app%2Fcva-date.component.ts

    Thanks for every one for answers , i think this issue could also resolved using parse method of moment date adapter but i like the ControlValueAccessor try as i control all the input aspects + reduce the code written when i want to use it in my html .

提交回复
热议问题