{#snippet MonthSelect()} { if (!placeholder) return; const v = Number.parseInt(e.currentTarget.value); const newPlaceholder = placeholder.set({ month: v }); placeholder = newPlaceholder.subtract({ months: monthIndex }); }} /> {/snippet} {#snippet YearSelect()} {/snippet} {#if captionLayout === "dropdown"} {@render MonthSelect()} {@render YearSelect()} {:else if captionLayout === "dropdown-months"} {@render MonthSelect()} {#if placeholder} {formatYear(placeholder)} {/if} {:else if captionLayout === "dropdown-years"} {#if placeholder} {formatMonth(placeholder)} {/if} {@render YearSelect()} {:else} {formatMonth(month)} {formatYear(month)} {/if}