Created
February 15, 2017 17:37
-
-
Save johnmurch/1be9abd4ec56b8628bbacd8e9a7aad9c to your computer and use it in GitHub Desktop.
Determine is today within 30 days of a date and/or has past
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var today = new Date(); | |
alert(today); | |
var future_date = new Date('2017/1/20 13:03:35 GMT-0400'); | |
alert(future_date); | |
var difference = future_date.getTime() - today.getTime(); | |
var thirty_days = 3600 * 24 * 30 * 1000; | |
alert(difference < thirty_days); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment