fix: update date formatting in DatePicker components and remove unused formatter imports

This commit is contained in:
Shariq Ansari 2025-09-02 17:13:28 +05:30
parent 92b79c2195
commit 2503dea30f
6 changed files with 22 additions and 11 deletions

View File

@ -200,8 +200,9 @@
:class="['[&_input]:w-[216px]']"
variant="outline"
:value="_event.fromDate"
:formatter="(date) => getFormat(date, 'MMM D, YYYY')"
:format="'MMM D, YYYY'"
:placeholder="__('May 1, 2025')"
:clearable="false"
@update:modelValue="(date) => updateDate(date, true)"
>
<template #suffix="{ togglePopover }">
@ -351,7 +352,7 @@ import DescriptionIcon from '@/components/Icons/DescriptionIcon.vue'
import TimePicker from '@/components/Calendar/TimePicker.vue'
import { globalStore } from '@/stores/global'
import { usersStore } from '@/stores/users'
import { getFormat, validateEmail } from '@/utils'
import { validateEmail } from '@/utils'
import { allTimeSlots } from '@/components/Calendar/utils'
import {
TextInput,

View File

@ -183,7 +183,7 @@
:value="row[field.fieldname]"
icon-left=""
variant="outline"
:formatter="(date) => getFormat(date, '', true)"
:format="getFormat('', '', true, false, false)"
input-class="border-none text-sm text-ink-gray-8"
@change="(v) => fieldChange(v, field, row)"
/>

View File

@ -141,7 +141,7 @@
<DatePicker
v-else-if="field.fieldtype === 'Date'"
:value="data[field.fieldname]"
:formatter="(date) => getFormat(date, '', true)"
:format="getFormat('', '', true, false, false)"
:placeholder="getPlaceholder(field)"
input-class="border-none"
@change="(v) => fieldChange(v, field)"

View File

@ -68,8 +68,9 @@
:class="[_event.isFullDay ? 'w-full' : 'w-[158px]']"
variant="outline"
:value="_event.fromDate"
:formatter="(date) => getFormat(date, 'MMM D, YYYY')"
:format="'MMM D, YYYY'"
:placeholder="__('May 1, 2025')"
:clearable="false"
@update:modelValue="(date) => updateDate(date, true)"
>
<template #suffix="{ togglePopover }">
@ -160,7 +161,6 @@ import {
dayjs,
} from 'frappe-ui'
import { globalStore } from '@/stores/global'
import { getFormat } from '@/utils'
import { onMounted, ref, computed } from 'vue'
const props = defineProps({

View File

@ -252,7 +252,7 @@
<DatePicker
icon-left=""
:value="doc[field.fieldname]"
:formatter="(date) => getFormat(date, '', true)"
:format="getFormat('', '', true, false, false)"
:placeholder="field.placeholder"
placement="left-start"
:hideIcon="true"

View File

@ -52,11 +52,21 @@
<!-- left side -->
<!-- Month Year -->
<div class="flex items-center">
<DateMonthYearPicker
<DatePicker
:modelValue="selectedMonthDate"
:formatter="() => currentMonthYear"
@update:modelValue="(val) => onMonthYearChange(val)"
/>
:clearable="false"
>
<template #target="{ togglePopover }">
<Button
variant="ghost"
class="text-lg font-medium text-ink-gray-7"
:label="currentMonthYear"
iconRight="chevron-down"
@click="togglePopover"
/>
</template>
</DatePicker>
</div>
<!-- right side -->
<!-- actions buttons for calendar -->
@ -125,7 +135,7 @@ import {
createListResource,
TabButtons,
dayjs,
DateMonthYearPicker,
DatePicker,
CalendarActiveEvent as activeEvent,
call,
} from 'frappe-ui'