vision refactor
This commit is contained in:
parent
ea4d685db4
commit
3fceeb0abc
@ -134,7 +134,11 @@ export default function VisionPage() {
|
||||
(calendar.events || []).forEach((event: any) => {
|
||||
const eventStart = new Date(event.start);
|
||||
const eventEnd = new Date(event.end);
|
||||
const dateStr = eventStart.toISOString().split('T')[0];
|
||||
// Use local date to avoid timezone issues
|
||||
const year = eventStart.getFullYear();
|
||||
const month = String(eventStart.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(eventStart.getDate()).padStart(2, '0');
|
||||
const dateStr = `${year}-${month}-${day}`;
|
||||
const timeStr = event.isAllDay ? "" : eventStart.toTimeString().slice(0, 5);
|
||||
|
||||
meetings.push({
|
||||
@ -292,16 +296,24 @@ export default function VisionPage() {
|
||||
return now >= fiveMinutesBeforeStart && now <= end;
|
||||
};
|
||||
|
||||
// Helper function to format date as YYYY-MM-DD in local timezone
|
||||
const formatDateLocal = (date: Date): string => {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
};
|
||||
|
||||
// Get today's meetings
|
||||
const getTodayMeetings = (): ScheduledMeeting[] => {
|
||||
const today = new Date();
|
||||
const todayStr = today.toISOString().split('T')[0];
|
||||
const todayStr = formatDateLocal(today);
|
||||
return scheduledMeetings.filter(meeting => meeting.date === todayStr);
|
||||
};
|
||||
|
||||
// Get meetings for a specific date
|
||||
const getMeetingsForDate = (date: Date): ScheduledMeeting[] => {
|
||||
const dateStr = date.toISOString().split('T')[0];
|
||||
const dateStr = formatDateLocal(date);
|
||||
return scheduledMeetings.filter(meeting => meeting.date === dateStr);
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user