by vglocus · 4y ago · 0 comments
In our case we (users of our API) are to specify date ranges, representing a list of partitions. So we are not counting nights between dates, but rather a set of daily or hourly buckets.
Here (maybe even only here) I argue that inclusive ranges feel more intuitive.
I find it much more intuitive to represent the 1st 7 days of January as
['2022-01-01', '2022-01-07']
compared to
['2022-01-01', '2022-01-08').
Another very common example is to specify the last 7 days (incl 'today') in which case I find
[today().minusDays(6), today()]
to be a clearer representation than
['today().minusDays(6)', 'today().plusDays(1)')
['2022-01-01', '2022-01-01' + days(7) )
Also, isn't this 6 days?
[today().minusDays(6), today()] --> ['2022-11-16', '2022-11-22']
To be fair, I'm considering these dates/times as singular points in time to the smallest resolution available in whatever time system is being used.