Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Function to find minimum time difference between any two time points in a list
const findMinTimeDiff = (listOfTimes) => {
/** Returns the minimum time difference in minutes between any two points **/
findMinTimeDiff(['00:00', '00:01']); //should return 1 minute
findMinTimeDiff(['00:03', '03:12', '00:00', '03:14']); //should return 2 minutes
findMinTimeDiff(['13:20', '00:01', '14:00', '18:05', '13:28']); //should return 8 minutes
findMinTimeDiff(['00:00', '00:02', '23:59', '00:05']); //should return 1 minute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.