Skip to content

Commit

Permalink
toggle button added for time selection and date selection in date pic…
Browse files Browse the repository at this point in the history
…ker widget, related to ToolJet#3576 (ToolJet#4255)

* toggle button added for time selection and date selection in date picker widget, related to ToolJet#3576

* Added validation for toggle values

Added validation for toggle values for enableTime and enableDate
  • Loading branch information
kaggrwal authored Oct 26, 2022
1 parent ff00f74 commit 0853685
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/docs/widgets/datepicker.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ The format of the date selected by the date picker. Default date format is **DD/

### Enable time selection?

Allows to select time if enabled. Time selection is disabled by default. This field requires a boolean value: `{{true}}` or `{{false}}`.
Toggle on or off to enable the time selection. You can programmatically determine the value by clicking on `Fx` to set the value `{{true}}` or `{{false}}`.

### Enable date selection?

Allows to select date if enabled. Date selection is enabled by default. This field requires a boolean value: `{{true}}` or `{{false}}`.
Toggle on or off to enable the date selection. You can programmatically determine the value by clicking on `Fx` to set the value `{{true}}` or `{{false}}`.

## Validation

Expand Down
6 changes: 4 additions & 2 deletions frontend/src/Editor/WidgetManager/widgetConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -1226,17 +1226,19 @@ export const widgets = [
},
},
enableTime: {
type: 'code',
type: 'toggle',
displayName: 'Enable time selection?',
validation: {
schema: { type: 'boolean' },
defaultValue: false,
},
},
enableDate: {
type: 'code',
type: 'toggle',
displayName: 'Enable date selection?',
validation: {
schema: { type: 'boolean' },
defaultValue: true,
},
},
disabledDates: {
Expand Down

0 comments on commit 0853685

Please sign in to comment.