Skip to content Skip to sidebar Skip to footer

Localising The Date Value In Angular Material Datepicker

I'm working with Angular Material date picker. My problem is that when I send a date to the Web Api controller, I get a date less than the date I have selected in my form. I think

Solution 1:

To get consistent result across browsers , its best to use moment.js

Otherwise you can also use the toLocaleString() .

Lastly you can also write your own service which will get UTC time and apply necessary offsets based on the user locale.

Post a Comment for "Localising The Date Value In Angular Material Datepicker"