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:53:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d3a06ca3b0b3e12d08c7e23aacc4d5668c2c0286
d3a06ca3
1 parent
bd730134
🐞 fix(日期时间组件): 最大最小值设置,需要区分日期格式
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
src/components/DateTimePickerField/index.vue
src/components/DateTimePickerField/index.vue
View file @
d3a06ca
...
...
@@ -158,12 +158,20 @@ onMounted(() => {
// 设置默认最大最小日期
if (data_minvalue.split(" ")[0].length) {
const min = data_minvalue.split(" ")[0].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.split(" ")[0].length) {
const max = data_maxvalue.split(" ")[0].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])
}
}
});
const required = props.item.component_props.required;
...
...
Please
register
or
login
to post a comment