Please help me getting the previous dates in angular 4.
currentdate: Date;
this.currentdate = new Date();
console.log(this.datePipe.transform(this.currentdate, 'yyyy-MM-dd'));
Here I got the date as 2017-11-13.
Now I need to get 2 days before date..
Try this
let dte = new Date();
dte.setDate(dte.getDate() - 2);
console.log(dte.toString());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With