I use datepicker c angular material. Here\'s the code:
-
You may resolve it like this :
For example, if your are getting date in -> one_day_back_date_value
var one_day_back_date_value = moment.tz(moment(date_value_from_backend), 0).format("YYYY-MM-DD");
date_value_from_backend = moment(one_day_back_date_value).toDate();
Please note : moment and moment-timezone libraries are must for this.
Include moment library above the moment-timezone library.
- 热议问题