Build a CSS date range selector with :nth-child(of)
How I stopped managing calendar range styling in JavaScript. The :nth-child(of) syntax plus the sibling combinator handles the highlight in CSS, leaving JS to do nothing but keep two checkboxes in sync.