logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 03d5c2e140fc70937d3533665fa88d055ab486f1
parent dd97a23ce70fc564d3142eb9d218ff1a929107b1
Author: tusooa <tusooa@kazv.moe>
Date:   Sun, 22 Jan 2023 11:22:24 -0500

Make date picker aware of the birthday max value

Diffstat:

Msrc/components/registration/registration.js3+++
Msrc/components/registration/registration.vue2+-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js @@ -71,6 +71,9 @@ const registration = { minDate.setTime(today.getTime() - minAge * DAY) return minDate }, + birthdayMinAttr () { + return this.birthdayMin.toJSON().replace(/T.+$/, '') + }, birthdayMinFormatted () { const browserLocale = localeService.internalToBrowserLocale(this.$i18n.locale) return this.user.birthday && new Date(Date.parse(this.birthdayMin)).toLocaleDateString(browserLocale, { timeZone: 'UTC', day: 'numeric', month: 'long', year: 'numeric' }) diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue @@ -183,7 +183,7 @@ :disabled="isPending" class="form-control" type="date" - max="birthdayMin" + :max="birthdayRequired ? birthdayMinAttr : undefined" :aria-required="birthdayRequired" > </div>