Source: app/util/getTimeBetween.js

/* eslint-disable import/prefer-default-export */
import moment from 'moment';

/**
 * Returns number of days from now until date passed through
 * @function
 * @param startDate - the startDate value
 * @param endDate - the date value that we are comparing to the startDate
 */
export const getMonthsBetween = (startDate, endDate) => moment(endDate).diff(startDate, 'months');

/**
 * Returns number of days from now until date passed through
 * @function
 * @param startDate - the startDate value
 * @param endDate - the date value that we are comparing to the startDate
 */
export const getDaysBetween = (startDate, endDate) => moment(endDate).diff(startDate, 'days');

/**
 * Returns number of hours from now until date passed through
 * @function
 * @param startDate - the startDate value
 * @param endDate - the date value that we are comparing to the startDate
 */
export const getHoursBetween = (startDate, endDate) => moment(endDate).diff(startDate, 'hours');

/**
 * Returns number of minutes from now until date passed through
 * @function
 * @param startDate - the startDate value
 * @param endDate - the date value that we are comparing to the startDate
 */
export const getMinutesBetween = (startDate, endDate) => moment(endDate).diff(startDate, 'minutes');