File tree Expand file tree Collapse file tree
resources/js/components/ui/DatePicker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import Card from '../Card/Card.vue';
2424import Button from ' ../Button/Button.vue' ;
2525import Calendar from ' ../Calendar/Calendar.vue' ;
2626import Icon from ' ../Icon/Icon.vue' ;
27+ import Text from ' ../Text.vue' ;
2728
2829const emit = defineEmits ([' update:modelValue' ]);
2930
@@ -95,6 +96,16 @@ const calendarEvents = computed(() => ({
9596 },
9697}));
9798
99+ const timeZoneName = computed (() => props .modelValue ? .timeZone ?? null );
100+
101+ const timeZoneLabel = computed (() => {
102+ const tz = timeZoneName .value ;
103+ if (! tz) return null ;
104+
105+ const parts = new Intl.DateTimeFormat (undefined , { timeZone: tz, timeZoneName: ' short' }).formatToParts (props .modelValue .toDate ());
106+ return parts .find ((p ) => p .type === ' timeZoneName' )? .value ?? tz;
107+ });
108+
98109const isInvalid = computed (() => {
99110 // Check if the component has invalid state from form validation
100111 return props .modelValue === null && props .required ;
@@ -187,6 +198,12 @@ const getInputLabel = (part) => {
187198 < / div>
188199 < / template>
189200 < / div>
201+ < Text
202+ class = " text-gray-600 dark:text-gray-400 me-1"
203+ size= " xs"
204+ v- tooltip= " timeZoneName"
205+ : text= " timeZoneLabel"
206+ / >
190207 < Button
191208 v- if = " clearable && !readOnly"
192209 @click= " emit('update:modelValue', null)"
You can’t perform that action at this time.
0 commit comments