Reduce confusion in date selector

by disabling entries which would cause from > to

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-01-22 21:47:17 +01:00
parent ed3f281092
commit 88d42f4da9
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -13,6 +13,7 @@
v-for="(name, idx) in monthNames" v-for="(name, idx) in monthNames"
:key="idx" :key="idx"
:value="idx" :value="idx"
:disabled="dateComponents.fromYear === dateComponents.toYear && idx > dateComponents.toMonth"
> >
{{ name }} {{ name }}
</option> </option>
@ -25,6 +26,7 @@
v-for="year in years" v-for="year in years"
:key="year" :key="year"
:value="year" :value="year"
:disabled="year > dateComponents.toYear"
> >
{{ year }} {{ year }}
</option> </option>
@ -41,6 +43,7 @@
v-for="(name, idx) in monthNames" v-for="(name, idx) in monthNames"
:key="idx" :key="idx"
:value="idx" :value="idx"
:disabled="dateComponents.fromYear === dateComponents.toYear && idx < dateComponents.fromMonth"
> >
{{ name }} {{ name }}
</option> </option>
@ -53,6 +56,7 @@
v-for="year in years" v-for="year in years"
:key="year" :key="year"
:value="year" :value="year"
:disabled="year < dateComponents.fromYear"
> >
{{ year }} {{ year }}
</option> </option>