diff --git a/index.html b/index.html index 99f203f..cd7848f 100644 --- a/index.html +++ b/index.html @@ -2,9 +2,8 @@ - - Tauri + Vue + Typescript App + Chrono Snap diff --git a/src/App.vue b/src/App.vue index 0d82a60..c6859fd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -251,6 +251,14 @@ const endTimeInput = computed({ set: (val) => { editingEvent.value.end_minute = logicalMinutesFromTime(val); } }); +const eventDurationFormatted = computed(() => { + let diff = editingEvent.value.end_minute - editingEvent.value.start_minute; + if (diff < 0) diff += 1440; + const h = Math.floor(diff / 60); + const m = diff % 60; + return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}`; +}); + const updatePreview = async (img: TimelineItem | null) => { if (!img || (selectedImage.value?.path === img.path && previewSrc.value)) return; selectedImage.value = img; @@ -525,10 +533,10 @@ const handleExport = async () => {

{{ editingEvent.id ? '编辑记录' : '新增记录' }}

-
+
-
- +
+
+ +
+ {{ eventDurationFormatted }} +
-
- +
+