-
Notifications
You must be signed in to change notification settings - Fork 573
Open
Description
Suppose we have the range 15.06.2016 23:59 ~ 16.06.2016 00:00
. The length of time between the start and the end is only 1 second, however this library displays "2 days" because it spans across 2 separate calendar dates. I suggest adding a way to configure this.
Configuration option: daysMode('span' / 'nights' / 'period')
if (daysMode === 'span') {
// Use the current behavior (default)
}
if (daysMode === 'nights') {
// Should be the same as the current behavior minus 1. This is the number of
// times the boundary between 23:59 and 00:00 is crossed
}
if (daysMode === 'period') {
// The actual number of complete 24 hour periods between one datetime and
// another.
// If we have Monday at 23:59 until Tuesday at 23:58 this should be 0, even
// though it crosses from one day to another.
}
I haven't looked at the code, but I can't see this being overly difficult to achieve. If you are interested let me know and I'll code it and submit a pull request.
Metadata
Metadata
Assignees
Labels
No labels