🌴 Stretch My Time Off

In {getFlagEmoji(selectedCountryCode)} {#if selectedState} {selectedState}, {/if} {selectedCountry} , there are {holidays.length} public holidays{#if visibleHolidaysCount < holidays.length} ({visibleHolidaysCount} selected){/if} in {year}.

Let's stretch your time off from {daysOff} days to {consecutiveDaysOff.reduce((total, group) => total + group.totalDays, 0)} days (how?)

I live in {getFlagEmoji(selectedCountryCode)} {#if Object.keys(statesList).length > 0} handleStateChange(e)} on:focus={(e) => { (e.target as HTMLInputElement).value = ''; }} placeholder="State" aria-label="State" /> {#each Object.entries(statesList) as [code, name]} {/each} in {/if} handleCountryChange(e)} on:focus={(e) => { (e.target as HTMLInputElement).value = ''; }} placeholder="Country" aria-label="Select country" /> and have {daysOff} days off in {year}

{#if year !== defaultYear || selectedCountry !== defaultCountry || daysOff !== defaultDaysOff} Reset to my country {/if} {#each Object.entries(countriesList) as [code, name]} {/each}
{#if showHolidaysList || showWeekendSettings}
{#if showHolidaysList}

Public Holidays

    {#each holidays as holiday}
  • {formatDate(holiday.date)}: {holiday.name}
  • {/each}
{/if} {#if showWeekendSettings}

Weekend Days

    {#each getOrderedDays() as {name, index}}
  • {name}
  • {/each}
{/if}
{/if}
{#each months as month}
{/each}
{#if showHowItWorks}

How does this work?

This tool detects your country from your IP, uses a default number of government-mandated days off from Wikipedia, and a list of holidays for {selectedCountry}.

The algorithm prioritizes filling the shortest gaps first. It optimizes for spreading your holidays throughout the year to create the most number of consecutive vacation periods.

For the calculation, it counts all vacation stretches that are 3 days or longer, including those lucky 3-day weekends thanks to public holidays. It's slightly optimistic, but captures the spirit of maximising time off.

Built with SvelteKit. Hosted on Vercel with Cloudflare. Developed using Cursor, an AI-powered code editor, and GPT-4o.

{/if}