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
function timeBetweenDates (dateTo, dateFrom) { | |
// get total seconds between the times | |
let delta = Math.abs(date_future - date_now) / 1000 | |
// calculate (and subtract) whole days | |
let days = Math.floor(delta / 86400) | |
delta -= days * 86400 | |
// calculate (and subtract) whole hours | |
let hours = Math.floor(delta / 3600) % 24 | |
delta -= hours * 3600 | |
// calculate (and subtract) whole minutes |
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
/** | |
* @param {array} array | |
* @param {string} attribute | |
* @param {array} sortOrder | |
*/ | |
function customArraySort (array, attribute, sortOrder) { | |
let ordering = {} | |
for (let i = 0; i < sortOrder.length; i++) { | |
ordering[sortOrder[i]] = i | |
} |
OlderNewer