Skip to content

Commit 5e0c8be

Browse files
author
Kenneth Cheng
committed
fix date/time default validation
1 parent 8037b76 commit 5e0c8be

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vue3-excel-editor",
33
"email": "apple.6502@gmail.com",
44
"description": "Vue3 plugin for displaying and editing the array-of-object in Excel style",
5-
"version": "1.0.7",
5+
"version": "1.0.8",
66
"main": "src/main.js",
77
"dependencies": {
88
"@vuepic/vue-datepicker": "^3.3.0",

src/VueExcelColumn.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,30 +116,36 @@ export default {
116116
break
117117
case 'date':
118118
allowKeys = allowKeys || ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-']
119+
/*
119120
if (!validate) validate = (val) => {
120121
if (val === '') return ''
121122
// if (!moment(val, 'YYYY-MM-DD', true).isValid()) return this.$parent.localizedLabel.invalidInputValue
122123
if (!/^\d{4}-\d{2}-\d{2}$/.test(val)) return this.$parent.localizedLabel.invalidInputValue
123124
return ''
124125
}
126+
*/
125127
break
126128
case 'datetime':
127129
allowKeys = allowKeys || ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', ' ', ':']
130+
/*
128131
if (!validate) validate = (val) => {
129132
if (val === '') return ''
130133
// if (!moment(val, 'YY-MM-DD hh:mm', true).isValid()) return this.$parent.localizedLabel.invalidInputValue
131134
if (!/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(val)) return this.$parent.localizedLabel.invalidInputValue
132135
return ''
133136
}
137+
*/
134138
break
135139
case 'datetimesec':
136140
allowKeys = allowKeys || ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', ' ', ':']
141+
/*
137142
if (!validate) validate = (val) => {
138143
if (val === '') return ''
139144
// if (!moment(val, 'YY-MM-DD hh:mm:ss', true).isValid()) return this.$parent.localizedLabel.invalidInputValue
140145
if (!/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(val)) return this.$parent.localizedLabel.invalidInputValue
141146
return ''
142147
}
148+
*/
143149
break
144150
case 'datetick':
145151
allowKeys = allowKeys || ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', ' ', ':']

0 commit comments

Comments
 (0)