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
/* calculate the difference in minutes between 2 date times | |
given that only the minutes within a specified time range | |
every day should be counted | |
e.g: say the time range is 6AM to 6PM | |
if datetime1 = 4AM and datetime2 = 5AM, difference = 0 minutes | |
this is because 4AM to 5AM doesn't fall within the range of | |
6AM to 6PM so the 60 minutes isn't counted | |
e.g 2: say we have same time range and, | |
datetime1 = 5AM today and datetime2 = 7PM tomorrow, | |
difference = 1440 minutes |
OlderNewer