diff --git a/snippets/tomorrow.md b/snippets/tomorrow.md index 1027c84ef..0d16b6bbf 100644 --- a/snippets/tomorrow.md +++ b/snippets/tomorrow.md @@ -2,7 +2,8 @@ Results in a string representation of tomorrow's date. -First we use `new Date()` to get today's date, then add one day using `Date.getDate()` and mutate the initial `Date` via `Date.setDate()`. Then we use construct the date string in `yyyy-mm-dd` format. +Use `new Date()` to get the current date, increment by one using `Date.getDate()` and set the value to the result using `Date.setDate()`. +Use `Date.prototype.toISOString()` to return a string in `yyyy-mm-dd` format. ```js const tomorrow = () => { @@ -14,6 +15,4 @@ const tomorrow = () => { ```js tomorrow(); // 2018-10-18 (if current date is 2018-10-18) -// if you need the time to indicate the start of the day as well: -`${tomorrow()}T00:00:00}: // 2018-10-18T00:00:00 ```