Skip to content

Commit 997c0b4

Browse files
duncanmccleanclaude
andcommitted
Only show time in index tooltip when time is enabled
The tooltip was always using timeStyle: 'long' which showed a misleading time even for date-only fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dcad5ae commit 997c0b4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

resources/js/components/fieldtypes/DateIndexFieldtype.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ const tooltip = computed(() => {
4242
return null;
4343
}
4444
45-
const formatter = new DateFormatter().options({ dateStyle: 'long', timeStyle: 'long', ...timezoneOption.value });
45+
const tooltipOptions = props.value.time_enabled
46+
? { dateStyle: 'long', timeStyle: 'long' }
47+
: { dateStyle: 'long' };
48+
49+
const formatter = new DateFormatter().options({ ...tooltipOptions, ...timezoneOption.value });
4650
4751
if (props.value.mode === 'range') {
4852
return formatter.date(new Date(props.value.start)) + '' + formatter.date(new Date(props.value.end));

0 commit comments

Comments
 (0)