Convert a Gregorian date to its ISO week-year or expand an ISO week into Monday-through-Sunday dates.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
The week’s Thursday determines its ISO year, while reverse lookup anchors week 1 to the week containing 4 January. Checking 28 December rejects week 53 in an ISO year that contains only 52 weeks.
2018-12-31
ISO year: 2019 ISO week: 1 Week start: 2018-12-31 Week end: 2019-01-06
Business reports group by ISO week, manufacturing plans expand week labels, and boundary tests cover late-December week years.