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

日期组件(从当前日期开始怎么做) #1

Open
Mrwangfan opened this issue May 31, 2018 · 1 comment
Open

日期组件(从当前日期开始怎么做) #1

Mrwangfan opened this issue May 31, 2018 · 1 comment

Comments

@Mrwangfan
Copy link

就是点击日期选择 默认的是当前日期2018-5-31 前面是没有其他日期的

@fuxingkai
Copy link
Owner

如果你需要这种效果的话,你可以去date-picker.js的attached方法里面把初始化年的数组改成这种

for (let i = 1900; i <= date.getFullYear(); i++) {
years.push(i);
}
改成
for (let i = date.getFullYear(); i <= 2030; i++) {
years.push(i);
}
然后再去getRefreshData方法里面把
var tempYearPos = this.data.years.length - 1;
改成
var tempYearPos = 0;

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