Update formatting
This commit is contained in:
@ -2,12 +2,13 @@
|
||||
title: daysFromNow
|
||||
tags: date,beginner
|
||||
firstSeen: 2020-10-09T02:49:17+03:00
|
||||
lastUpdated: 2020-10-20T11:21:07+03:00
|
||||
lastUpdated: 2022-01-30T11:48:07+03:00
|
||||
---
|
||||
|
||||
Calculates the date of `n` days from today as a string representation.
|
||||
|
||||
- Use `new Date()` to get the current date, `Math.abs()` and `Date.prototype.getDate()` to update the date accordingly and set to the result using `Date.prototype.setDate()`.
|
||||
- Use the `Date` constructor to get the current date.
|
||||
- Use `Math.abs()` and `Date.prototype.getDate()` to update the date accordingly and set to the result using `Date.prototype.setDate()`.
|
||||
- Use `Date.prototype.toISOString()` to return a string in `yyyy-mm-dd` format.
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user