Why is the date in datepicker angular showing the last day?

前端 未结 6 690
深忆病人
深忆病人 2021-01-12 13:13

I use datepicker c angular material. Here\'s the code:


 
6条回答
  •  孤城傲影
    2021-01-12 13:34

    Try this and it resolved the issue and there is nothing to do with the datepicker

    const d = new Date(fieldDate);
    d.setMinutes(d.getMinutes() + d.getTimezoneOffset());
    console.log(d);
    

提交回复
热议问题