Add isBeforeDate, isAfterDate, isSameDate
This commit is contained in:
13
snippets/isAfterDate.md
Normal file
13
snippets/isAfterDate.md
Normal file
@ -0,0 +1,13 @@
|
||||
### isAfterDate
|
||||
|
||||
Check if a date is after another date.
|
||||
|
||||
Use the greater than operator (`>`) to check if the first date comes after the second one.
|
||||
|
||||
```js
|
||||
const isAfterDate = (dateA, dateB) => dateA > dateB;
|
||||
```
|
||||
|
||||
```js
|
||||
isAfterDate(new Date(2010, 10, 21), new Date(2010, 10, 20)); // true
|
||||
```
|
||||
Reference in New Issue
Block a user