From Dev.to
Finding the Middle Date Without Confusing Calendar Days and Timestamps
If two dates are three days apart, no calendar date is equally distant from both. I'll show how I handle that gap in JavaScript with an explicit earlier-date rule, without confusing calendar-day count...
