🌴 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 from { showDatePicker = true; datePickerValue = formatDateForInput(startDate); }} class="bold start-date-link"> {@html formatStartDate(startDate)} until the end of {year}

{#if year !== defaultYear || selectedCountry !== defaultCountry} {@const yearDifferent = year !== defaultYear} {@const countryDifferent = selectedCountry !== defaultCountry} {yearDifferent && countryDifferent ? 'Reset to current country and year' : yearDifferent ? 'Reset to current year' : 'Reset to current country'} {/if} {#each Object.entries(countriesList) as [code, name]} {/each}
{#if showHolidaysList || showWeekendSettings || showFixedDaysOffList}
{#if showFixedDaysOffList}

Fixed Days Off

{#if fixedDaysOff.length > 0}
    {#each fixedDaysOff.sort((a, b) => a.getTime() - b.getTime()) as fixedDay}
  • {formatDate(fixedDay)}
  • {/each}
{:else}

Tap on a calendar day below to select it as a fixed day off

{/if}
{/if} {#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} {#if hasExcludedMonths()}
{/if}
{#each visibleMonths as month}
{/each}
{#if showDatePicker}
showDatePicker = false}>

Set Start Date

Choose when your time off period begins for {year}

{#if isTodayInYear()} {/if} {#if !isStartDateJan1st()} {/if}
{/if} {#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}