This file contains 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
## | |
# Having two times, group the time by dates in percentages. | |
# Time and analysis will be done in the timezone the time is passed with. | |
# Result for time range D1-D5: | |
# D1 |-----D2------------D3------------D4------| D5 | |
# 16.67% 32.34% 32.34% 16.67% | |
def date_range_group(start_time, end_time) | |
return nil unless start_time | |
return nil unless end_time > start_time | |
total = end_time - start_time |
NewerOlder