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

n-date-picker 组件 同时设置 :default-time="['00:00:00', '23:59:59']" 和 :shortcuts="rangeShortcuts" 属性时shortcuts的时分秒可以覆盖默认时间值 #3020

Closed
opcooc opened this issue May 27, 2022 · 0 comments
Labels
feature request New feature or request

Comments

@opcooc
Copy link

opcooc commented May 27, 2022

This function solves the problem (这个功能解决的问题)

解决n-date-picker 组件的 :default-time属性 可以被 shortcuts 设置覆盖

Expected API (期望的 API)

rangeShortcuts: {
近7天: () => {
const cur = new Date().getTime();
return [cur - 7 * 24 * 60 * 60 * 1000, cur];
},
近3天: () => {
const cur = new Date().getTime();
return [cur - 3 * 24 * 60 * 60 * 1000, cur];
},
近1天: () => {
const cur = new Date().getTime();
return [cur - 24 * 60 * 60 * 1000, cur];
},
近2小时: () => {
const cur = new Date().getTime();
return [cur - 2 * 60 * 60 * 1000, cur];
}
},
image

@github-actions github-actions bot added the feature request New feature or request label May 27, 2022
@opcooc opcooc changed the title n-date-picker 组件 同时设置 :default-time="['00:00:00', '23:59:59']" 和 :shortcuts="rangeShortcuts" 属性时shortcuts的时分秒无法覆盖默认时间值 n-date-picker 组件 同时设置 :default-time="['00:00:00', '23:59:59']" 和 :shortcuts="rangeShortcuts" 属性时shortcuts的时分秒可以覆盖默认时间值 May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant