diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js index 9df11e491..b8ec122e0 100644 --- a/public/js/apps/Dashboard/Fhc.js +++ b/public/js/apps/Dashboard/Fhc.js @@ -198,17 +198,6 @@ const router = VueRouter.createRouter({ ] }) -router.beforeEach((to, from) => { - // this avoids redundant routing navigation in place due to router.replace on a route with param function and - // beforeEnter navigation guard - - // TODO: manage the infinite forward navigation issue somehow - // https://stackoverflow.com/questions/28028297/how-can-i-delete-a-window-history-state?rq=3 - if (to.fullPath === from.fullPath) { - return false - } -}) - const app = Vue.createApp({ name: 'FhcApp', data: () => ({ diff --git a/public/js/components/Calendar/Month.js b/public/js/components/Calendar/Month.js index 9d35707a0..520c4d0d9 100644 --- a/public/js/components/Calendar/Month.js +++ b/public/js/components/Calendar/Month.js @@ -44,7 +44,6 @@ export default { this.emitRangeChanged() }, emitRangeChanged(mounted = false) { - this.$emit('change:range', { start: new Date(this.focusDate.y, this.focusDate.m, 1), end: new Date(this.focusDate.y, this.focusDate.m+1, 0), diff --git a/public/js/components/Calendar/Month/Page.js b/public/js/components/Calendar/Month/Page.js index 6d6b27d21..3aa6d41c9 100644 --- a/public/js/components/Calendar/Month/Page.js +++ b/public/js/components/Calendar/Month/Page.js @@ -67,10 +67,12 @@ export default { let classstring = 'fhc-calendar-month-page-day text-decoration-none overflow-hidden' const isHighlightedWeek = this.isHighlightedWeek(week) const isHighlightedDay = this.isHighlightedDay(day) - const isThisDate = this.date.compare(day) + const isThisDate = this.focusDate.compare(day) + const isNotThisMonth = day.getMonth() != this.month const isInThePast = day.getTime() < this.today // this.date is just the focusDate but not the initial Date + if(isThisDate) classstring += ' border-8' if(isHighlightedWeek) classstring += ' fhc-highlight-week' if(isHighlightedDay) classstring += ' fhc-highlight-day' diff --git a/public/js/components/Calendar/Months.js b/public/js/components/Calendar/Months.js index 1647f6f6a..6263e1b01 100644 --- a/public/js/components/Calendar/Months.js +++ b/public/js/components/Calendar/Months.js @@ -12,6 +12,7 @@ export default { ], data() { return { + // TODO: 36, 24, 16 (2+ 12 + 2) months to enable year switch? monthIndices: [...Array(12).keys()] } }, diff --git a/public/js/components/Calendar/Week.js b/public/js/components/Calendar/Week.js index 132660d78..9e5baac76 100644 --- a/public/js/components/Calendar/Week.js +++ b/public/js/components/Calendar/Week.js @@ -1,6 +1,8 @@ import CalendarAbstract from './Abstract.js'; import CalendarPane from './Pane.js'; import CalendarWeekPage from './Week/Page.js'; +import BsModal from "../Bootstrap/Modal.js"; +import Weeks from "./Weeks"; export default { mixins: [ @@ -8,7 +10,9 @@ export default { ], components: { CalendarWeekPage, - CalendarPane + CalendarPane, + BsModal, + Weeks }, computed: { title() { @@ -16,6 +20,16 @@ export default { } }, methods: { + handleWeekChanged(week) { + // this.$emit('change:offset', { y: 0, m: month - this.focusDate.m, d: 0 }); + this.$refs.modalDatepickerContainer.hide() + }, + hideMonthsModal() { + this.$refs.modalDatepickerContainer.hide() + }, + handleHeaderClickWeek() { + this.$refs.modalDatepickerContainer.show() + }, paneChanged(dir) { this.focusDate.d += dir * 7; this.emitRangeChanged(); @@ -42,7 +56,7 @@ export default { }, template: /*html*/`
- + @@ -54,5 +68,12 @@ export default { -
` + + + + + +` } diff --git a/public/js/components/Calendar/Weeks.js b/public/js/components/Calendar/Weeks.js index 76243c67b..b8300b4b5 100644 --- a/public/js/components/Calendar/Weeks.js +++ b/public/js/components/Calendar/Weeks.js @@ -4,10 +4,19 @@ export default { mixins: [ CalendarAbstract ], + emits: [ + 'change' + ], inject: [ 'size', 'focusDate' ], + props: { + header: { + type: Boolean, + default: true + } + }, computed: { weeks(){ return [...Array(this.focusDate.numWeeks).keys()].map(i => i + 1); @@ -20,7 +29,7 @@ export default { setWeek(week) { // TODO(chris): test is there a week jump on year select? => yes there is if the same month/day are in different weeks ... should we prevent that? this.focusDate.w = week; - this.$emit('updateMode', 'week'); + this.$emit('change', week); }, prev(){ this.focusDate.y--; @@ -33,7 +42,7 @@ export default { }, template: `
- +