Skip to content

Commit

Permalink
Merge pull request #255 from codetapacademy/fix--bad-time-conversion-…
Browse files Browse the repository at this point in the history
…#254

fix: bad time conversion
  • Loading branch information
marianzburlea authored Sep 22, 2019
2 parents 6a0a411 + 401bfbb commit 9fbc0e9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/component/_dumb/dynamic-form/dynamic-form.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ const DynamicForm = ({ schema, data, dbItem }) => {
}

const onEvent = (value, field, type) => {
// TODO: pune inca o valoare particularizata in baza de date (user)
console.log(value, field, type, formSchema.filedList[field])
// fix: bad time conversion #254
if (formSchema.filedList[field].type === 'time' && value.length === 5 && type === 'blur') {
value = `${value}:00`
}

switch (type) {
case 'change':
setFormSchema({
Expand Down

0 comments on commit 9fbc0e9

Please sign in to comment.