@@ -6,17 +6,17 @@ import Controls from './Controls'
66import Year from './Year'
77import Key from './Key'
88import { ICalendarPropTypes , IControls , blockedDaysType , IYear } from './types'
9- import timezone from "dayjs/plugin/timezone" ;
10- import utc from "dayjs/plugin/utc" ;
11- import advancedFormat from "dayjs/plugin/advancedFormat" ;
9+ // import timezone from "dayjs/plugin/timezone";
10+ // import utc from "dayjs/plugin/utc";
11+ // import advancedFormat from "dayjs/plugin/advancedFormat";
1212import customParseFormat from 'dayjs/plugin/customParseFormat'
1313
14- const defaultTimeZone = 'Europe/London' ;
14+ // const defaultTimeZone = 'Europe/London';
1515
16- dayjs . extend ( utc ) ;
17- dayjs . extend ( timezone ) ;
18- dayjs . extend ( advancedFormat ) ;
19- dayjs . tz . setDefault ( defaultTimeZone ) ;
16+ // dayjs.extend(utc);
17+ // dayjs.extend(timezone);
18+ // dayjs.extend(advancedFormat);
19+ // dayjs.tz.setDefault(defaultTimeZone);
2020dayjs . extend ( isBetween ) ;
2121dayjs . extend ( customParseFormat ) ;
2222
@@ -31,7 +31,7 @@ const Calendar = ({
3131 const initialPage = 1
3232 const totalCalendarMonths = 12
3333 const _showNumberOfMonths = isValidMonthsOption ( showNumberOfMonths ) ? showNumberOfMonths : totalCalendarMonths
34- const _year = dayjs . tz ( ) . year ( ) ;
34+ const _year = dayjs ( ) . year ( ) ;
3535 const [ activeYear , setActiveYear ] = useState ( _year )
3636 const [ bookedDates , setBookedDates ] = useState < blockedDaysType > ( [ ] )
3737 const [ lateCheckouts , setLateCheckouts ] = useState < blockedDaysType > ( [ ] )
@@ -55,7 +55,7 @@ const Calendar = ({
5555 )
5656
5757 const findActivePage = useCallback ( ( ) => {
58- const now = dayjs . tz ( )
58+ const now = dayjs ( )
5959 const _month = now . month ( ) + 1
6060 let _page = 1
6161 for ( let i = 1 ; i <= totalPages ; i ++ ) {
@@ -74,7 +74,7 @@ const Calendar = ({
7474 } , [ findActivePage , _showNumberOfMonths ] )
7575
7676 const initCal = useCallback ( ( ) => {
77- const now = dayjs . tz ( )
77+ const now = dayjs ( )
7878 const _year = now . year ( )
7979 setActiveYear ( _year )
8080 if ( _showNumberOfMonths !== totalCalendarMonths ) findActivePage ( )
@@ -85,7 +85,7 @@ const Calendar = ({
8585 const isFirstPage = page === 1
8686
8787 if ( isFirstPage ) {
88- const _previousYear = dayjs . tz ( `${ activeYear } ` ) . subtract ( 1 , 'year' ) . year ( )
88+ const _previousYear = dayjs ( `${ activeYear } ` ) . subtract ( 1 , 'year' ) . year ( )
8989 setActiveYear ( _previousYear )
9090
9191 if ( _showNumberOfMonths === totalCalendarMonths ) {
@@ -110,7 +110,7 @@ const Calendar = ({
110110 const next = useCallback ( ( ) => {
111111 const isLastPage = page === totalPages
112112 if ( isLastPage ) {
113- const _nextYear = dayjs . tz ( `${ activeYear } ` ) . add ( 1 , 'year' ) . year ( )
113+ const _nextYear = dayjs ( `${ activeYear } ` ) . add ( 1 , 'year' ) . year ( )
114114 setActiveYear ( _nextYear )
115115 resetCalendarYear ( )
116116 return
0 commit comments