Created
November 14, 2012 22:09
-
-
Save sauntimo/4075187 to your computer and use it in GitHub Desktop.
Compare Two Dates in Javascript
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
// create Javascript Date Object of Date entered | |
var OrderFor = new Date(NewSubmission["Month"] + " " + NewSubmission["Day"] + ", " + NewSubmission["Year"]); | |
var Submitted = new Date(e.values[0]); | |
// milliseconds between two dates divided by milliseconds in a day, rounded down | |
var Notice = Math.floor((OrderFor.getTime() - Submitted.getTime()) / (1000 * 60 * 60 * 24)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment