Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Calculate days left in js (React native)
_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