Skip to content

Commit

Permalink
fix(schema-formio): fix datetime component
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Jul 18, 2023
1 parent 69c214a commit e51952c
Show file tree
Hide file tree
Showing 4 changed files with 308 additions and 241 deletions.
Expand Up @@ -5,17 +5,17 @@ function dateToComponent(schema: any, options: any) {
const component = execMapper("default", schema, options);

const base = {
...component,
enableMinDateInput: false,
enableTime: false,
enableMaxDateInput: false,
input: true,
...component,
type: "datetime",
datePicker: {
disableWeekends: false,
disableWeekdays: false,
...getValue(component, "datePicker")
},
enableMaxDateInput: false,
enableTime: false,
type: "datetime",
input: true,
widget: {
type: "calendar",
displayInTimezone: "viewer",
Expand All @@ -42,7 +42,8 @@ function dateToComponent(schema: any, options: any) {
widget: {
...base.widget,
enableTime: false,
format: "yyyy-MM-dd"
format: "yyyy-MM-dd",
...getValue(component, "widget")
}
};
}
Expand All @@ -54,6 +55,7 @@ function dateToComponent(schema: any, options: any) {
...getValue(component, "timePicker")
},
widget: {
...base.widget,
enableTime: true,
time_24hr: true,
...getValue(component, "widget")
Expand Down

0 comments on commit e51952c

Please sign in to comment.