File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/tools/timezone-converter Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ function convertMinsToHrsMins(minutes: number) {
17
17
const otherTimezones = useStorage <{ name: string }[]>(' timezone-conv:zones' , [{ name: ' Etc/GMT' }]);
18
18
const currentTimezone = useStorage <string >(' timezone-conv:current' , browserTimezone );
19
19
const use24HourTimeFormat = useStorage <boolean >(' timezone-conv:24h' , true );
20
+ const format = computed (() => use24HourTimeFormat .value ? ' yyyy-MM-dd HH:mm:ss' : ' yyyy-MM-dd hh:mm:ss a' );
21
+ const timePickerProps = computed (() => use24HourTimeFormat .value ? ({ use12Hours: false }) : ({ use12Hours: true }));
20
22
21
23
const now = Date .now ();
22
24
const currentDatetimeRange = ref <[number , number ]>([now , now ]);
@@ -55,14 +57,17 @@ const countryToTimezonesOutput = computed(() => ctz.getTimezonesForCountry(count
55
57
mb-2
56
58
/>
57
59
<n-date-picker
60
+ :key =" format"
58
61
v-model:value =" currentDatetimeRange"
59
62
type =" datetimerange"
63
+ :format =" format"
64
+ :time-picker-props =" timePickerProps"
60
65
mb-2
61
66
/>
62
67
63
68
<n-space justify =" space-evenly" >
64
69
<input-copyable
65
- label =" Current Timezone Offset (min) "
70
+ label =" Current Timezone Offset"
66
71
label-position =" left"
67
72
:value =" currentTimezoneOffset"
68
73
readonly
You can’t perform that action at this time.
0 commit comments