Add isBeforeDate, isAfterDate, isSameDate

This commit is contained in:
Angelos Chalaris
2018-09-29 13:58:38 +03:00
parent e9c20ed7f5
commit e8d4ad78d9
15 changed files with 55 additions and 17 deletions

13
snippets/isAfterDate.md Normal file
View 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
```