fix: keep birthdays and show Shamsi dates
Imported customers keep their birthday, and assistant text plus remaining calendars use the Jalali date. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,7 +5,8 @@ import axios from 'axios';
|
||||
import { api } from '@/lib/api';
|
||||
import type { CompanyDto, CreatePersonRequest, PersonDto, PersonMood } from '@mento/shared';
|
||||
import { PERSON_MOOD_LABELS, PERSON_MOODS } from '@/lib/person-mood';
|
||||
import { toFaDigits } from '@/lib/jalali';
|
||||
import { formatLocalDateInput, parseLocalInput, toFaDigits } from '@/lib/jalali';
|
||||
import JalaliDateInput from '@/components/JalaliDateInput.vue';
|
||||
import {
|
||||
filterPhoneContacts,
|
||||
isContactPickerSupported,
|
||||
@@ -63,6 +64,7 @@ const mobile = ref('');
|
||||
const position = ref('');
|
||||
const website = ref('');
|
||||
const instagram = ref('');
|
||||
const birthDate = ref('');
|
||||
const referrer = ref('');
|
||||
const addresses = ref<string[]>(['']);
|
||||
const notes = ref('');
|
||||
@@ -209,6 +211,7 @@ function fill(p: PersonDto) {
|
||||
position.value = p.position ?? '';
|
||||
website.value = p.website ?? '';
|
||||
instagram.value = p.instagram ?? '';
|
||||
birthDate.value = p.birthDate ? formatLocalDateInput(new Date(p.birthDate)) : '';
|
||||
referrer.value = p.referrer ?? '';
|
||||
addresses.value = p.addresses?.length ? [...p.addresses] : [''];
|
||||
notes.value = p.notes ?? '';
|
||||
@@ -285,6 +288,7 @@ function payload(): CreatePersonRequest {
|
||||
position: position.value || undefined,
|
||||
website: website.value || undefined,
|
||||
instagram: instagram.value || undefined,
|
||||
birthDate: birthDate.value ? parseLocalInput(birthDate.value)?.toISOString() ?? null : null,
|
||||
referrer: referrer.value || undefined,
|
||||
addresses: addresses.value.map((a) => a.trim()).filter(Boolean),
|
||||
notes: notes.value || undefined,
|
||||
@@ -483,6 +487,10 @@ onMounted(load);
|
||||
<UiInput id="instagram" v-model="instagram" dir="ltr" placeholder="@username یا لینک" />
|
||||
</UiField>
|
||||
|
||||
<UiField label="تاریخ تولد" for-id="birth-date">
|
||||
<JalaliDateInput id="birth-date" v-model="birthDate" mode="date" />
|
||||
</UiField>
|
||||
|
||||
<UiField label="معرف" for-id="referrer">
|
||||
<UiInput id="referrer" v-model="referrer" placeholder="نام معرف" />
|
||||
</UiField>
|
||||
|
||||
Reference in New Issue
Block a user