mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-23 00:06:15 -04:00
fix: 12hours format for input and ui overflow
This commit is contained in:
parent
04f2ec1729
commit
66bfb2db02
1 changed files with 6 additions and 1 deletions
|
@ -17,6 +17,8 @@ function convertMinsToHrsMins(minutes: number) {
|
||||||
const otherTimezones = useStorage<{ name: string }[]>('timezone-conv:zones', [{ name: 'Etc/GMT' }]);
|
const otherTimezones = useStorage<{ name: string }[]>('timezone-conv:zones', [{ name: 'Etc/GMT' }]);
|
||||||
const currentTimezone = useStorage<string>('timezone-conv:current', browserTimezone);
|
const currentTimezone = useStorage<string>('timezone-conv:current', browserTimezone);
|
||||||
const use24HourTimeFormat = useStorage<boolean>('timezone-conv:24h', true);
|
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 now = Date.now();
|
||||||
const currentDatetimeRange = ref<[number, number]>([now, now]);
|
const currentDatetimeRange = ref<[number, number]>([now, now]);
|
||||||
|
@ -55,14 +57,17 @@ const countryToTimezonesOutput = computed(() => ctz.getTimezonesForCountry(count
|
||||||
mb-2
|
mb-2
|
||||||
/>
|
/>
|
||||||
<n-date-picker
|
<n-date-picker
|
||||||
|
:key="format"
|
||||||
v-model:value="currentDatetimeRange"
|
v-model:value="currentDatetimeRange"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
|
:format="format"
|
||||||
|
:time-picker-props="timePickerProps"
|
||||||
mb-2
|
mb-2
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<n-space justify="space-evenly">
|
<n-space justify="space-evenly">
|
||||||
<input-copyable
|
<input-copyable
|
||||||
label="Current Timezone Offset (min)"
|
label="Current Timezone Offset"
|
||||||
label-position="left"
|
label-position="left"
|
||||||
:value="currentTimezoneOffset"
|
:value="currentTimezoneOffset"
|
||||||
readonly
|
readonly
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue