Update daysAgo.md

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-07 21:12:41 +03:00
committed by GitHub
parent ce3ded1c1a
commit 1fbbf52a4d

View File

@ -10,9 +10,9 @@ Returns the date of `n` days ago from today as a string representation.
```js
const daysAgo = n => {
let t = new Date();
t.setDate(t.getDate() - Math.abs(n));
return t.toISOString().split('T')[0];
let d = new Date();
d.setDate(d.getDate() - Math.abs(n));
return d.toISOString().split('T')[0];
};
```