Enhance visual indication of a selected date range
See original GitHub issueI would love to see a visual indication of selected dates that fall in the middle of a date range selection. While useful in small date ranges, this is especially useful for ranges that fall across multiple months where there is no indication at all that a date is within a range. Perhaps something similar to the DateRangePicker component.
I think it would be relatively simple with the addition of a css class to all values falling within the range and unique classes for the ends of the range. I say unique classes so that one could style the end start and end dates differently such as in the example image below where the start date has a left border radius and the end date has a right border radius.
Possible implementation:
Here i’ve added the classes startRange
, inRange
, and endRange
.
...
<span class="flatpickr-day" tabindex="0">18</span>
<span class="flatpickr-day" tabindex="0">19</span>
<span class="flatpickr-day selected startRange" tabindex="0">20</span>
<span class="flatpickr-day inRange" tabindex="0">21</span>
<span class="flatpickr-day inRange" tabindex="0">22</span>
<span class="flatpickr-day inRange" tabindex="0">23</span>
<span class="flatpickr-day inRange" tabindex="0">24</span>
<span class="flatpickr-day selected endRange" tabindex="0">25</span>
<span class="flatpickr-day" tabindex="0">26</span>
<span class="flatpickr-day" tabindex="0">27</span>
...
Example screenshot from the DateRangePicker:
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Exactly what I was planning. Will be implemented by next release
@davidklebanoff Doh! You’re right, found it. Cheers