refactor: code clean up
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { parseCalendarDate } from '@/utils/date'
|
||||
import { formatTime as formatClockTime } from '@/utils/format'
|
||||
|
||||
const props = defineProps<{
|
||||
event: any | null
|
||||
@@ -13,12 +14,7 @@ const emit = defineEmits<{
|
||||
}>()
|
||||
|
||||
const formatTime = (isoString: string | null | undefined): string => {
|
||||
if (!isoString) return 'Not set'
|
||||
const date = new Date(isoString)
|
||||
return date.toLocaleTimeString('en-US', {
|
||||
hour: 'numeric',
|
||||
minute: '2-digit'
|
||||
})
|
||||
return isoString ? formatClockTime(new Date(isoString)) : 'Not set'
|
||||
}
|
||||
|
||||
const formatAllDayDate = (isoString: string | null | undefined): string => {
|
||||
|
||||
Reference in New Issue
Block a user