cally icon indicating copy to clipboard operation
cally copied to clipboard

week selection

Open eydun opened this issue 4 months ago • 5 comments

Thanks for building this project.

Is it possible to show week-numbers, and perhaps have a week‑selection mode?

eydun avatar Aug 03 '25 11:08 eydun

There's an open PR here for week numbers. I need to solve some accessibility problems with it before shipping. I just haven't had a chance https://github.com/WickyNilliams/cally/pull/53

I've never heard/seen of a week select before. Do any other calendar/date pickers offer this? Were you thinking just a <select> with 53 options?

WickyNilliams avatar Aug 04 '25 21:08 WickyNilliams

You can likely just build your own if you wish, similar to how I built a year select here https://codepen.io/WickyNilliams/pen/GRLYYRP

You'd need to do some date math to calculate the week. There's an implementation in JS here https://weeknumber.co.uk/how-to/javascript

I likely won't implement it myself, it's kinda niche. I am however working on official month/year select components (building on the above codepen). So I will close this issue now. But happy to continue discussion

WickyNilliams avatar Aug 04 '25 21:08 WickyNilliams

Do any other calendar/date pickers offer this?

I saw that flatpickr had it as a plugin: https://flatpickr.js.org/plugins/#weekselect

There's an open PR here for week numbers

Awesome! Looking forward to it.

eydun avatar Aug 05 '25 09:08 eydun

Oh I see what you mean. I thought you meant to jump to specific weeks, but you meant selecting a week like you'd select a date. I'll have a think on that. There might be something we can do!

WickyNilliams avatar Aug 05 '25 10:08 WickyNilliams

I'll reopen this as a reminder to myself. I might still not implement it, but I'll investigate how much work is involved

WickyNilliams avatar Aug 05 '25 10:08 WickyNilliams