-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIO-2453: Fixes an issue where custom disabled dates are bot recalcul… (
#5490) * FIO-2453: Fixes an issue where custom disabled dates are bot recalculated after for valus is changed * Fixed tests --------- Co-authored-by: alexandraRamanenka <[email protected]>
- Loading branch information
1 parent
9430a58
commit 34d3689
Showing
4 changed files
with
157 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
export default { | ||
type: 'form', | ||
display: 'form', | ||
components: [ | ||
{ | ||
label: 'Min Date', | ||
tableView: false, | ||
datePicker: { | ||
disableWeekends: false, | ||
disableWeekdays: false | ||
}, | ||
enableMinDateInput: false, | ||
enableMaxDateInput: false, | ||
key: 'minDate', | ||
type: 'datetime', | ||
input: true, | ||
widget: { | ||
type: 'calendar', | ||
displayInTimezone: 'viewer', | ||
locale: 'en', | ||
useLocaleSettings: false, | ||
allowInput: true, | ||
mode: 'single', | ||
enableTime: true, | ||
noCalendar: false, | ||
format: 'yyyy-MM-dd hh:mm a', | ||
hourIncrement: 1, | ||
minuteIncrement: 1, | ||
// eslint-disable-next-line camelcase | ||
time_24hr: false, | ||
minDate: null, | ||
disableWeekends: false, | ||
disableWeekdays: false, | ||
maxDate: null | ||
} | ||
}, | ||
{ | ||
label: 'Max Date', | ||
tableView: false, | ||
enableMinDateInput: false, | ||
datePicker: { | ||
disableWeekends: false, | ||
disableWeekdays: false | ||
}, | ||
enableMaxDateInput: false, | ||
validate: { | ||
custom: "var minDate = moment(data.minDate);\nvar maxDate = moment(data.maxDate);\nvalid = maxDate.isAfter(minDate)? true : 'Max date must be after min date'" | ||
}, | ||
key: 'maxDate', | ||
type: 'datetime', | ||
input: true, | ||
widget: { | ||
type: 'calendar', | ||
displayInTimezone: 'viewer', | ||
locale: 'en', | ||
useLocaleSettings: false, | ||
allowInput: true, | ||
mode: 'single', | ||
enableTime: true, | ||
noCalendar: false, | ||
format: 'yyyy-MM-dd hh:mm a', | ||
hourIncrement: 1, | ||
minuteIncrement: 1, | ||
// eslint-disable-next-line camelcase | ||
time_24hr: false, | ||
minDate: null, | ||
disableWeekends: false, | ||
disableWeekdays: false, | ||
maxDate: null | ||
} | ||
}, | ||
{ | ||
label: 'In Between Date', | ||
tableView: false, | ||
datePicker: { | ||
disableFunction: '!moment(date).isBetween(moment(data.minDate), moment(data.maxDate))', | ||
disableWeekends: false, | ||
disableWeekdays: false | ||
}, | ||
enableMinDateInput: false, | ||
enableMaxDateInput: false, | ||
key: 'inBetweenDate', | ||
customConditional: 'show = !!data.minDate && !!data.maxDate', | ||
type: 'datetime', | ||
input: true, | ||
widget: { | ||
type: 'calendar', | ||
displayInTimezone: 'viewer', | ||
locale: 'en', | ||
useLocaleSettings: false, | ||
allowInput: true, | ||
mode: 'single', | ||
enableTime: true, | ||
noCalendar: false, | ||
format: 'yyyy-MM-dd hh:mm a', | ||
hourIncrement: 1, | ||
minuteIncrement: 1, | ||
// eslint-disable-next-line camelcase | ||
time_24hr: false, | ||
minDate: null, | ||
disableWeekends: false, | ||
disableWeekdays: false, | ||
disableFunction: '!moment(date).isBetween(moment(data.minDate), moment(data.maxDate))', | ||
maxDate: null | ||
} | ||
}, | ||
{ | ||
type: 'button', | ||
label: 'Submit', | ||
key: 'submit', | ||
disableOnInvalid: true, | ||
input: true, | ||
tableView: false | ||
} | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters