mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 22:43:06 -04:00
Merge branch 'fix/birthdate' into 'main'
QOL enhancements to birthdate editor See merge request ShowMeBillyJo/Zaimki!1
This commit is contained in:
commit
a7283fe156
@ -212,7 +212,7 @@
|
|||||||
<T>profile.birthdayInfo</T>
|
<T>profile.birthdayInfo</T>
|
||||||
</p>
|
</p>
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<datepicker v-model="birthday" inline :disabled-dates="disabledDates" initial-view="year"/>
|
<datepicker v-model="birthday" inline :disabled-dates="disabledDates" :open-date="disabledDates.from" :initial-view="birthday !== null ? 'day' : 'year'"/>
|
||||||
</div>
|
</div>
|
||||||
<PropagateCheckbox field="birthday" :before="beforeChanges.birthday" :after="birthday" v-if="otherProfiles > 0" @change="propagateChanged"/>
|
<PropagateCheckbox field="birthday" :before="beforeChanges.birthday" :after="birthday" v-if="otherProfiles > 0" @change="propagateChanged"/>
|
||||||
</section>
|
</section>
|
||||||
@ -281,7 +281,7 @@
|
|||||||
import { buildPronoun } from "../src/buildPronoun";
|
import { buildPronoun } from "../src/buildPronoun";
|
||||||
import config from '../data/config.suml';
|
import config from '../data/config.suml';
|
||||||
import link from '../plugins/link';
|
import link from '../plugins/link';
|
||||||
import {minBirthdate, maxBirthdate, formatDate} from '../src/birthdate';
|
import {minBirthdate, maxBirthdate, formatDate, parseDate} from '../src/birthdate';
|
||||||
import opinions from '../src/opinions';
|
import opinions from '../src/opinions';
|
||||||
import t from '../src/translator';``
|
import t from '../src/translator';``
|
||||||
|
|
||||||
@ -329,7 +329,7 @@
|
|||||||
names: profile.names,
|
names: profile.names,
|
||||||
pronouns: profile.pronouns,
|
pronouns: profile.pronouns,
|
||||||
description: profile.description,
|
description: profile.description,
|
||||||
birthday: profile.birthday,
|
birthday: parseDate(profile.birthday),
|
||||||
timezone: profile.timezone,
|
timezone: profile.timezone,
|
||||||
links: profile.links,
|
links: profile.links,
|
||||||
flags: profile.flags,
|
flags: profile.flags,
|
||||||
@ -356,7 +356,7 @@
|
|||||||
names: profile.names,
|
names: profile.names,
|
||||||
pronouns: [],
|
pronouns: [],
|
||||||
description: '',
|
description: '',
|
||||||
birthday: profile.birthday,
|
birthday: parseDate(profile.birthday),
|
||||||
timezone: profile.timezone,
|
timezone: profile.timezone,
|
||||||
links: profile.links,
|
links: profile.links,
|
||||||
flags: profile.flags.filter(f => !f.startsWith('-')),
|
flags: profile.flags.filter(f => !f.startsWith('-')),
|
||||||
|
@ -11,6 +11,7 @@ module.exports = {
|
|||||||
return `${bd.getFullYear()}-${('0' + (bd.getMonth() + 1)).slice(-2)}-${('0' + bd.getDate()).slice(-2)}`;
|
return `${bd.getFullYear()}-${('0' + (bd.getMonth() + 1)).slice(-2)}-${('0' + bd.getDate()).slice(-2)}`;
|
||||||
},
|
},
|
||||||
parseDate(bd) {
|
parseDate(bd) {
|
||||||
|
if (typeof(bd) !== 'string') { return bd; }
|
||||||
return new Date(
|
return new Date(
|
||||||
parseInt(bd.substring(0, 4)),
|
parseInt(bd.substring(0, 4)),
|
||||||
parseInt(bd.substring(5, 7)) - 1,
|
parseInt(bd.substring(5, 7)) - 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user