@@ -6,17 +6,17 @@ import Controls from './Controls'
6
6
import Year from './Year'
7
7
import Key from './Key'
8
8
import { 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";
12
12
import customParseFormat from 'dayjs/plugin/customParseFormat'
13
13
14
- const defaultTimeZone = 'Europe/London' ;
14
+ // const defaultTimeZone = 'Europe/London';
15
15
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);
20
20
dayjs . extend ( isBetween ) ;
21
21
dayjs . extend ( customParseFormat ) ;
22
22
@@ -31,7 +31,7 @@ const Calendar = ({
31
31
const initialPage = 1
32
32
const totalCalendarMonths = 12
33
33
const _showNumberOfMonths = isValidMonthsOption ( showNumberOfMonths ) ? showNumberOfMonths : totalCalendarMonths
34
- const _year = dayjs . tz ( ) . year ( ) ;
34
+ const _year = dayjs ( ) . year ( ) ;
35
35
const [ activeYear , setActiveYear ] = useState ( _year )
36
36
const [ bookedDates , setBookedDates ] = useState < blockedDaysType > ( [ ] )
37
37
const [ lateCheckouts , setLateCheckouts ] = useState < blockedDaysType > ( [ ] )
@@ -55,7 +55,7 @@ const Calendar = ({
55
55
)
56
56
57
57
const findActivePage = useCallback ( ( ) => {
58
- const now = dayjs . tz ( )
58
+ const now = dayjs ( )
59
59
const _month = now . month ( ) + 1
60
60
let _page = 1
61
61
for ( let i = 1 ; i <= totalPages ; i ++ ) {
@@ -74,7 +74,7 @@ const Calendar = ({
74
74
} , [ findActivePage , _showNumberOfMonths ] )
75
75
76
76
const initCal = useCallback ( ( ) => {
77
- const now = dayjs . tz ( )
77
+ const now = dayjs ( )
78
78
const _year = now . year ( )
79
79
setActiveYear ( _year )
80
80
if ( _showNumberOfMonths !== totalCalendarMonths ) findActivePage ( )
@@ -85,7 +85,7 @@ const Calendar = ({
85
85
const isFirstPage = page === 1
86
86
87
87
if ( isFirstPage ) {
88
- const _previousYear = dayjs . tz ( `${ activeYear } ` ) . subtract ( 1 , 'year' ) . year ( )
88
+ const _previousYear = dayjs ( `${ activeYear } ` ) . subtract ( 1 , 'year' ) . year ( )
89
89
setActiveYear ( _previousYear )
90
90
91
91
if ( _showNumberOfMonths === totalCalendarMonths ) {
@@ -110,7 +110,7 @@ const Calendar = ({
110
110
const next = useCallback ( ( ) => {
111
111
const isLastPage = page === totalPages
112
112
if ( isLastPage ) {
113
- const _nextYear = dayjs . tz ( `${ activeYear } ` ) . add ( 1 , 'year' ) . year ( )
113
+ const _nextYear = dayjs ( `${ activeYear } ` ) . add ( 1 , 'year' ) . year ( )
114
114
setActiveYear ( _nextYear )
115
115
resetCalendarYear ( )
116
116
return
0 commit comments