mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
Set currentView of calendar correctly when default view is not month (#1510)
This commit is contained in:
parent
f3828339cb
commit
828e35094e
1 changed files with 6 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Calendar as ReactCalendar, momentLocalizer } from 'react-big-calendar';
|
||||
import moment from 'moment';
|
||||
import 'react-big-calendar/lib/css/react-big-calendar.css';
|
||||
|
|
@ -73,6 +73,11 @@ export const Calendar = function ({
|
|||
? properties.defaultView
|
||||
: allowedCalendarViews[0];
|
||||
|
||||
useEffect(() => {
|
||||
setExposedVariable('currentView', defaultView);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [defaultView]);
|
||||
|
||||
const components = {
|
||||
timeGutterHeader: () => <div style={{ height: '100%', display: 'flex', alignItems: 'flex-end' }}>All day</div>,
|
||||
week: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue