An algorithm to optimise vacation days using public holidays and weekends. Especially relevant at this time of year.
I created it a year ago and received quite some comments on the Show HN post[1]. Last weekend I updated it to work for end of year planning and adding fixed days off, which seems to solve most of the feedback. It was done with Cursor in agent mode.
Thanks! I made options to change the year and leave balance, but not to change the first day of the year. Let me know if it still works if you enter the right number of days
Thanks a lot, now there's a quick feature to toggle off certain holidays, I see most US don't get Veteran's day indeed. It should work now, per state as well
Thanks so much! ChatGPT and I just added a quick feature to hide certain holidays from a particular year, stored in LocalStorage. Let me know if it works like you expect :)
Thanks, the count could indeed be improved. I left it as counting all clusters > 2 days as valid extra time off, so all 3 day weekends made from national holidays would be included. But of course it's over optimistic :)
Thanks for sharing! The option to toggle holidays on/off should be working. Being able to arbitrarily add a chosen day isn't there, you just need to +1 to your days off count and let the algorithm choose for you.
Thanks for your feedback! Indeed the algorithm only gives one result, as it tries to fill all gaps from smallest to biggest in the best way possible to create clusters.
Making it super customisable would be tough, as then it becomes just a personal calendar. Maybe showing the rankings transparently (3 options tied, choose which one wins) could be nice.
Hi Zachd,
I like this, but I'd like to be able to do it for custom date ranges, and add custom constraints.
for example, my company has mandatory shutdown days, I have x additional days leave, and z study days leave that I expected to not use more than 1 study day in the same week and I need to use some of my leave by 30 jun as australia businesses manage the financial year as july to june, not jan to december.
Even a simple weighting might work… “do you prefer your time off to be near major public holidays?” Or “which season do you prefer to travel?” Then with the 4 day weeks accordingly. The results it gave me skipped over a lot of other federal holidays and seemed to focus all time off at years end, when I definitely do not want to travel. Which really it just needs to look for weeks with a single day off to buddy up with.
I think a simple feature that would actually effectively enable what they wanted would be to let the user manually add days which should be included in the PTO
Like maybe make the days clickable and give us a popover button for : it'd like this day to be free - and just tread this day as a holiday from there (while deducting the day from the quota)
An algorithm to optimise vacation days using public holidays and weekends. Especially relevant at this time of year.
I created it a year ago and received quite some comments on the Show HN post[1]. Last weekend I updated it to work for end of year planning and adding fixed days off, which seems to solve most of the feedback. It was done with Cursor in agent mode.
[1]: https://news.ycombinator.com/item?id=42118039