fix now line

This commit is contained in:
Julian Freeman
2026-03-23 00:24:40 -04:00
parent da2ea0da11
commit afc227159a

View File

@@ -19,7 +19,7 @@ const isSetupComplete = ref(false);
const savePath = ref("");
const dbPath = ref("");
const isPaused = ref(false);
const currentDate = ref(new Date().toLocaleDateString('sv'));
const currentDate = ref(new Date(Date.now() - TIME_OFFSET_MINUTES * 60000).toLocaleDateString('sv'));
const timelineImages = ref<TimelineItem[]>([]);
const selectedImage = ref<TimelineItem | null>(null);
const lockedImage = ref<TimelineItem | null>(null);
@@ -59,7 +59,8 @@ const currentLogicalMinute = ref(-1);
let currentMinuteInterval: number | null = null;
const updateCurrentMinute = () => {
const now = new Date();
if (now.toLocaleDateString('sv') === currentDate.value) {
const logicalDateStr = new Date(now.getTime() - TIME_OFFSET_MINUTES * 60000).toLocaleDateString('sv');
if (logicalDateStr === currentDate.value) {
const m = now.getHours() * 60 + now.getMinutes();
currentLogicalMinute.value = (m < TIME_OFFSET_MINUTES ? m + 1440 : m) - TIME_OFFSET_MINUTES;
} else {
@@ -520,7 +521,7 @@ const handleExport = async () => {
<div v-else class="flex flex-1 overflow-hidden">
<div class="w-80 bg-[#F8FAFD] border-r border-[#E5E5E7] flex flex-col select-none relative">
<div class="p-6 bg-[#F8FAFD]/80 backdrop-blur-md sticky top-0 z-50 border-b border-[#E5E5E7]/50">
<div class="p-6 bg-[#F8FAFD]/80 backdrop-blur-md sticky top-0 z-100 border-b border-[#E5E5E7]/50">
<div class="flex items-center justify-between mb-4"><h2 class="text-lg font-bold">瞬影 - 时间记录</h2><button @click="loadTimeline(true); loadEvents()" class="p-2 hover:bg-white rounded-xl text-[#86868B]"><RefreshCw :size="18" /></button></div>
<div ref="calendarRef" class="relative group">
<button @click="isCalendarOpen = !isCalendarOpen" class="w-full bg-white border border-[#E5E5E7] rounded-xl pl-11 pr-4 py-2.5 text-sm font-bold text-left flex items-center hover:bg-[#F2F2F7] transition-all">