Skip to content

Commit 401bfbb

Browse files
committed
fix: bad time conversion
this closes #254
1 parent 6a0a411 commit 401bfbb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/component/_dumb/dynamic-form/dynamic-form.component.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ const DynamicForm = ({ schema, data, dbItem }) => {
3030
}
3131

3232
const onEvent = (value, field, type) => {
33-
// TODO: pune inca o valoare particularizata in baza de date (user)
34-
console.log(value, field, type, formSchema.filedList[field])
33+
// fix: bad time conversion #254
34+
if (formSchema.filedList[field].type === 'time' && value.length === 5 && type === 'blur') {
35+
value = `${value}:00`
36+
}
37+
3538
switch (type) {
3639
case 'change':
3740
setFormSchema({

0 commit comments

Comments
 (0)