-1

I have a mat calendar used for filtering service data but the problem is when I tried to convert the picker date format I found an error on the result for example when the mat calendar data = Fri Apr 17 2020 00:00:00 GMT+0100(West Africa Standard Time) the conversion result 5/3/2020 23:0:017 when the correct data should be = 17/4/2020 00:00:00

my code

update_by_date(evt){
    this.Display_clander = false;
    console.log(evt);
    let myDate = new Date(evt);
    console.log(myDate);
  }
ala freestyle
  • 109
  • 10

1 Answers1

0

I have created a demo for your problem. Demo here

where you can check console after selecting a date and you will get the proper result as you expected. Don't know why did you get a different result.

RBC
  • 478
  • 1
  • 3
  • 12