Skip to content

Commit

Permalink
fix: 12hours format for input and ui overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sharevb committed Sep 14, 2024
1 parent 04f2ec1 commit 66bfb2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tools/timezone-converter/timezone-converter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function convertMinsToHrsMins(minutes: number) {
const otherTimezones = useStorage<{ name: string }[]>('timezone-conv:zones', [{ name: 'Etc/GMT' }]);
const currentTimezone = useStorage<string>('timezone-conv:current', browserTimezone);
const use24HourTimeFormat = useStorage<boolean>('timezone-conv:24h', true);
const format = computed(() => use24HourTimeFormat.value ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd hh:mm:ss a');
const timePickerProps = computed(() => use24HourTimeFormat.value ? ({ use12Hours: false }) : ({ use12Hours: true }));
const now = Date.now();
const currentDatetimeRange = ref<[number, number]>([now, now]);
Expand Down Expand Up @@ -55,14 +57,17 @@ const countryToTimezonesOutput = computed(() => ctz.getTimezonesForCountry(count
mb-2
/>
<n-date-picker
:key="format"
v-model:value="currentDatetimeRange"
type="datetimerange"
:format="format"
:time-picker-props="timePickerProps"
mb-2
/>

<n-space justify="space-evenly">
<input-copyable
label="Current Timezone Offset (min)"
label="Current Timezone Offset"
label-position="left"
:value="currentTimezoneOffset"
readonly
Expand Down

0 comments on commit 66bfb2d

Please sign in to comment.