diff --git a/grafana-plugin/src/models/schedule/schedule.ts b/grafana-plugin/src/models/schedule/schedule.ts index 081dd95cfe..61bb21666c 100644 --- a/grafana-plugin/src/models/schedule/schedule.ts +++ b/grafana-plugin/src/models/schedule/schedule.ts @@ -538,7 +538,7 @@ export class ScheduleStore extends BaseStore { const startMoment = this.rootStore.timezoneStore.calendarStartDate; const days = - getTotalDaysToDisplay(scheduleView || this.scheduleView, this.rootStore.timezoneStore.calendarStartDate) + 1; + getTotalDaysToDisplay(scheduleView || this.scheduleView, this.rootStore.timezoneStore.calendarStartDate) + 2; try { const schedule = await this.loadItem(scheduleId); @@ -614,7 +614,7 @@ export class ScheduleStore extends BaseStore { async updateShiftSwaps(scheduleId: Schedule['id'], startMoment: dayjs.Dayjs) { const fromString = getFromString(startMoment); - const days = getTotalDaysToDisplay(this.scheduleView, this.rootStore.timezoneStore.calendarStartDate) + 1; + const days = getTotalDaysToDisplay(this.scheduleView, this.rootStore.timezoneStore.calendarStartDate) + 2; const dayBefore = startMoment.subtract(1, 'day'); @@ -658,7 +658,7 @@ export class ScheduleStore extends BaseStore { async updatePersonalEvents(userPk: ApiSchemas['User']['pk'], startMoment: dayjs.Dayjs, isUpdateOnCallNow = false) { const fromString = getFromString(startMoment); - const days = getTotalDaysToDisplay(ScheduleView.OneWeek, this.rootStore.timezoneStore.calendarStartDate) + 1; + const days = getTotalDaysToDisplay(ScheduleView.OneWeek, this.rootStore.timezoneStore.calendarStartDate) + 2; const dayBefore = startMoment.subtract(1, 'day'); diff --git a/grafana-plugin/src/pages/schedule/Schedule.styles.ts b/grafana-plugin/src/pages/schedule/Schedule.styles.ts index 077d1ac22b..73328590c4 100644 --- a/grafana-plugin/src/pages/schedule/Schedule.styles.ts +++ b/grafana-plugin/src/pages/schedule/Schedule.styles.ts @@ -47,5 +47,11 @@ export const getScheduleStyles = (theme: GrafanaTheme2) => { margin: 50px auto; text-align: center; `, + + datePicker: css` + position: absolute; + z-index: 1060; + top: 0; + `, }; }; diff --git a/grafana-plugin/src/pages/schedule/Schedule.tsx b/grafana-plugin/src/pages/schedule/Schedule.tsx index ff8625d6a9..703627adc7 100644 --- a/grafana-plugin/src/pages/schedule/Schedule.tsx +++ b/grafana-plugin/src/pages/schedule/Schedule.tsx @@ -333,18 +333,20 @@ class _SchedulePage extends React.Component - { - store.timezoneStore.setCalendarStartDate( - getCalendarStartDate(dayjs(newDate), scheduleView) - ); - this.handleDateRangeUpdate(); - this.setState({ calendarStartDatePickerIsOpen: false }); - }} - onClose={() => this.setState({ calendarStartDatePickerIsOpen: false })} - /> +
+ { + store.timezoneStore.setCalendarStartDate( + getCalendarStartDate(dayjs(newDate), scheduleView) + ); + this.handleDateRangeUpdate(); + this.setState({ calendarStartDatePickerIsOpen: false }); + }} + onClose={() => this.setState({ calendarStartDatePickerIsOpen: false })} + /> +