diff --git a/frontend/src/components/DateTimePicker.vue b/frontend/src/components/DateTimePicker.vue index be4df76..15bbf58 100644 --- a/frontend/src/components/DateTimePicker.vue +++ b/frontend/src/components/DateTimePicker.vue @@ -10,6 +10,7 @@ export enum TabType { + + + + diff --git a/frontend/src/components/calendar/CalendarGrid.vue b/frontend/src/components/calendar/CalendarGrid.vue new file mode 100644 index 0000000..095a040 --- /dev/null +++ b/frontend/src/components/calendar/CalendarGrid.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/frontend/src/components/calendar/CollectionToggleItem.vue b/frontend/src/components/calendar/CollectionToggleItem.vue new file mode 100644 index 0000000..df816b8 --- /dev/null +++ b/frontend/src/components/calendar/CollectionToggleItem.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/frontend/src/components/calendar/ScheduleList.vue b/frontend/src/components/calendar/ScheduleList.vue new file mode 100644 index 0000000..071a199 --- /dev/null +++ b/frontend/src/components/calendar/ScheduleList.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/frontend/src/components/calendar/types.ts b/frontend/src/components/calendar/types.ts new file mode 100644 index 0000000..e3a93f0 --- /dev/null +++ b/frontend/src/components/calendar/types.ts @@ -0,0 +1,26 @@ +/** A single analyzed event occurrence placed into a calendar day cell. */ +export interface DisplayEvent { + uuid: string; + belongTo: string; + title: string; + description: string; + color: string; + isVisible: boolean; + isLocked: boolean; + loopText: string; + timezoneWarning: boolean; + start: string; + end: string; +} + +/** A single day cell in the 6x7 calendar grid, carrying its events. */ +export interface DisplayDay { + /** 1-12 */ + month: number; + day: number; + /** 1-7, Monday = 1 */ + dayOfWeek: number; + isCurrentMonth: boolean; + subcalendar: string; + events: DisplayEvent[]; +} diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 5257034..4366c76 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -3,7 +3,7 @@ import { createPinia } from 'pinia' import { library } from '@fortawesome/fontawesome-svg-core' import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' -import { faUser, faLock, faPen, faShare, faTrash, faCheck, faTimes, faPlus, faSync } from '@fortawesome/free-solid-svg-icons' +import { faUser, faLock, faPen, faShare, faTrash, faCheck, faTimes, faPlus, faSync, faChevronCircleLeft, faChevronCircleRight, faEye, faEyeSlash, faRetweet, faGlobe } from '@fortawesome/free-solid-svg-icons' import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' @@ -19,7 +19,7 @@ const app = createApp(App); app.use(pinia); app.use(router); -library.add(faUser, faLock, faPen, faShare, faTrash, faCheck, faTimes, faPlus, faSync); +library.add(faUser, faLock, faPen, faShare, faTrash, faCheck, faTimes, faPlus, faSync, faChevronCircleLeft, faChevronCircleRight, faEye, faEyeSlash, faRetweet, faGlobe); app.component('font-awesome-icon', FontAwesomeIcon); app.mount('#app'); diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index dc59e94..4eaf4a2 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -18,7 +18,8 @@ const routes = [ { path: '/todo', name: "Todo", meta: { requireLoggedInCheck: true }, component: Todo }, { path: '/admin', name: "Admin", meta: { requireLoggedInCheck: true }, component: Admin }, - { path: '/calendar/event', name: "CalendarEvent", meta: { requireLoggedInCheck: true }, component: CalendarEvent }, + { path: '/calendar/event', name: "CalendarEventAdd", meta: { requireLoggedInCheck: true }, component: CalendarEvent }, + { path: '/calendar/event/:uuid', name: "CalendarEventUpdate", meta: { requireLoggedInCheck: true }, component: CalendarEvent }, { path: '/login', name: "Login", meta: { requireLoggedOutCheck: true }, component: Login }, { path: '/404', name: "NotFound", component: NotFound }, @@ -52,4 +53,8 @@ export const goToHome = () => { router.push({ name: 'Home' }) } +export const goToCalendar = () => { + router.push({ name: 'Calendar' }) +} + export default router diff --git a/frontend/src/utils/calendar-names.ts b/frontend/src/utils/calendar-names.ts new file mode 100644 index 0000000..9a56892 --- /dev/null +++ b/frontend/src/utils/calendar-names.ts @@ -0,0 +1,8 @@ +export const MONTH_NAMES: string[] = [ + 'January', 'February', 'March', 'April', 'May', 'June', + 'July', 'August', 'September', 'October', 'November', 'December' +]; + +export const WEEK_NAMES: string[] = [ + 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' +]; diff --git a/frontend/src/utils/datetime.ts b/frontend/src/utils/datetime.ts index 2fee3c3..bb41e2d 100644 --- a/frontend/src/utils/datetime.ts +++ b/frontend/src/utils/datetime.ts @@ -451,7 +451,7 @@ type DayInMonthInfo = [ weeksBackwardDayOfWeek: number, ]; -function getDayInMonth(year: number, month: number, day: number): DayInMonthInfo { +export function getDayInMonth(year: number, month: number, day: number): DayInMonthInfo { const days = MONTH_DAY_COUNT[month - 1]! + ((month == 2 && isLeapYear(year)) ? 1 : 0); const firstDayOfWeek = dayOfWeek(year, month, 1); const bilateralDayOfWeek = (firstDayOfWeek + day - 1) % 7; diff --git a/frontend/src/views/Calendar.vue b/frontend/src/views/Calendar.vue index 5dc7276..d02037a 100644 --- a/frontend/src/views/Calendar.vue +++ b/frontend/src/views/Calendar.vue @@ -1,8 +1,344 @@ - + diff --git a/frontend/src/views/CalendarEvent.vue b/frontend/src/views/CalendarEvent.vue index 7cfaba0..b4db3cb 100644 --- a/frontend/src/views/CalendarEvent.vue +++ b/frontend/src/views/CalendarEvent.vue @@ -1,8 +1,322 @@ - + - +