Created
June 19, 2018 14:08
-
-
Save rwoloszyn/6eb000ab2d3b7845e590776379432a82 to your computer and use it in GitHub Desktop.
Calculate days left in js (React native)
This file contains 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
_getLeftActivationDays = (finishDate) => { | |
var endDate = new Date(finishDate); | |
var today = new Date(); | |
var oneDay = 24 * 60 * 60 * 1000; | |
return Math.round(Math.abs((today.getTime() - endDate.getTime())/ oneDay)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment