Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2024-08-08 18:40:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bd730134e6aec82163c89e101c1e49d070cb90dd
bd730134
1 parent
ba46a088
🐞 fix(日期组件): 最大最小值设置,需要区分日期格式
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
src/components/DatePickerField/index.vue
src/components/DatePickerField/index.vue
View file @
bd73013
<!--
* @Date: 2022-08-31 11:45:30
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-08-0
7 18:13:4
6
* @LastEditTime: 2024-08-0
8 18:39:3
6
* @FilePath: /data-table/src/components/DatePickerField/index.vue
* @Description: 日期选择组件
-->
...
...
@@ -110,12 +110,20 @@ onMounted(() => {
}
// 设置默认最大最小日期
if (data_minvalue.length) {
const min = data_minvalue.split("-")
minDate.value = new Date(+min[0], +min[1] - 1, +min[2])
const min = data_minvalue.split("-");
if (date_format === 'YYYY-MM') {
minDate.value = new Date(+min[0], +min[1] - 1)
} else {
minDate.value = new Date(+min[0], +min[1] - 1, +min[2])
}
}
if (data_maxvalue.length) {
const max = data_maxvalue.split("-")
maxDate.value = new Date(+max[0], +max[1] - 1, +max[2])
const max = data_maxvalue.split("-");
if (date_format === 'YYYY-MM') {
maxDate.value = new Date(+max[0], +max[1] - 1)
} else {
maxDate.value = new Date(+max[0], +max[1] - 1, +max[2])
}
}
});
...
...
Please
register
or
login
to post a comment