Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

显示月份内容数据有问题 #71

Open
Accide opened this issue Nov 8, 2020 · 1 comment
Open

显示月份内容数据有问题 #71

Accide opened this issue Nov 8, 2020 · 1 comment

Comments

@Accide
Copy link

Accide commented Nov 8, 2020

每月应该是显示42个数据,现在的代码有可能会显示35条,各位需要使用的注意点

@weijiatan456
Copy link

weijiatan456 commented Jul 15, 2021

在calendar.js中,找到方法getRightArr,改一下_length这一行即可

    getRightArr(date) {
        const arr = [];
        const nextDate = this.getOtherMonth(date, 'nextMonth');
        const leftLength = this.getDaysInOneMonth(date) + this.getMonthweek(date);
        const _length = leftLength < 35 ? 14 - leftLength % 7 : 7 - leftLength % 7;
        for (let i = 0; i < _length; i++) {
            const nowTime = nextDate.getFullYear() + '/' + (nextDate.getMonth() + 1) + '/' + (i + 1);
            arr.push({
                id: i + 1,
                date: nowTime,
                isToday: false,
                otherMonth: 'nextMonth',
            });
        }
        return arr;
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants