Quote (kdog3682 @ Dec 5 2019 02:33am)
Given a start date and an end date, write a function that calculates how many days it takes to reach the end date.
Code
startDateToEndDate({start: '12/5/19', end: '12/8/19'}) returns '3 days'
startDateToEndDate({start: '12/5/19', end: '1/1/19'}) returns '27 days'
Pay-out goes to the first answer posted in the thread.
edit: removed, just noticed you want this to work with dates that aren't in the right order. moment.
This post was edited by frixionburne on Dec 9 2019 05:45pm