Skip to content

Commit e565e34

Browse files
committed
use string instead of XDate
1 parent ce2bb84 commit e565e34

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/expandableCalendar/Context/Presenter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ class Presenter {
7575
return toMarkingFormat(new XDate());
7676
};
7777

78-
getPositionAnimation = (date: XDate, todayBottomMargin = 0) => {
79-
const toValue = isToday(date) ? TOP_POSITION : -todayBottomMargin || -TOP_POSITION;
78+
getPositionAnimation = (date: string, todayBottomMargin = 0) => {
79+
const toValue = isToday(new XDate(date)) ? TOP_POSITION : -todayBottomMargin || -TOP_POSITION;
8080
return {
8181
toValue,
8282
tension: 30,

src/expandableCalendar/Context/Provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class CalendarProvider extends Component<Props> {
9898

9999
const updateState = (buttonIcon: number) => {
100100
this.setState({date, prevDate: this.state.date, updateSource, buttonIcon}, () => {
101-
this.animateTodayButton(new XDate(date));
101+
this.animateTodayButton(date);
102102
});
103103
};
104104

@@ -117,7 +117,7 @@ class CalendarProvider extends Component<Props> {
117117
setDisabled(showTodayButton, disabled, this.state.disabled, updateState);
118118
};
119119

120-
animateTodayButton(date: XDate) {
120+
animateTodayButton(date: string) {
121121
const {shouldAnimateTodayButton, getPositionAnimation} = this.presenter;
122122

123123
if (shouldAnimateTodayButton(this.props)) {

0 commit comments

Comments
 (0)