Skip to content

Commit

Permalink
fix: calendar month (#1149)
Browse files Browse the repository at this point in the history
* chore: 优化calendar

* fix: calendar month

---------

Co-authored-by: Yang <yangpan@zhongan.com>
  • Loading branch information
Yang03 and Yang authored Oct 26, 2023
1 parent 490eade commit 86a0dde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/zarm/src/calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ const Calendar = React.forwardRef<HTMLDivElement, CalendarProps>((props, ref) =>

const months = useMemo(() => {
const month: Date[] = [];
const len = dayjs(max).diff(min, 'month');
const dateMax = dayjs(max);
const dateMin = dayjs(min);
const len = (dateMax.year() - dateMin.year()) * 12 + dateMax.month() - dateMin.month();
let i = 0;
do {
month.push(dayjs(min).add(i, 'month').toDate());
Expand Down

1 comment on commit 86a0dde

@vercel
Copy link

@vercel vercel bot commented on 86a0dde Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zarm – ./

zarm-git-master-zhongantech.vercel.app
zarm-zhongantech.vercel.app

Please sign in to comment.