From bb6342ce24b419a0271f4dea67527a22b83e43b6 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 7 Oct 2020 09:11:36 +0300 Subject: [PATCH] Update daysAgo.md --- snippets/daysAgo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/daysAgo.md b/snippets/daysAgo.md index 8769b1b71..738696050 100644 --- a/snippets/daysAgo.md +++ b/snippets/daysAgo.md @@ -9,7 +9,7 @@ Returns the date of `n` days ago from today as a string representation. - Use `Date.prototype.toISOString()` to return a string in `yyyy-mm-dd` format. ```js -const daysAgo = (n) => { +const daysAgo = n => { let t = new Date(); t.setDate(t.getDate() - Math.abs(n)); return t.toISOString().split('T')[0];