Skip to content

Commit

Permalink
fiw scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Aug 16, 2022
1 parent c07d549 commit c73f74f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ DateRangePicker.propTypes = {
* Disable specific date. @DateIOType
* @template TDate
* @param {TDate} day The date to test.
* @param {'start' | 'end'} position The date to test.
* @returns {boolean} Returns `true` if the date should be disabled.
*/
shouldDisableDate: PropTypes.func,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ export function DateRangePickerViewDesktop<TDate>(props: DesktopDateRangeCalenda
changeMonth(utils.getPreviousMonth(currentMonth));
}, [changeMonth, currentMonth, utils]);

const wrappedShouldDisableDate = (dayToTest) =>
!!shouldDisableDate?.(dayToTest, currentlySelectingRangeEnd);
const wrappedShouldDisableDate =
shouldDisableDate &&
((dayToTest: TDate) => shouldDisableDate?.(dayToTest, currentlySelectingRangeEnd));

return (
<DateRangePickerViewDesktopRoot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export interface ExportedMobileDateRangeCalendarProps<TDate>

interface DesktopDateRangeCalendarProps<TDate>
extends ExportedMobileDateRangeCalendarProps<TDate>,
Omit<DayPickerProps<TDate>, 'selectedDays' | 'renderDay' | 'onFocusedDayChange'>,
Omit<
DayPickerProps<TDate>,
'selectedDays' | 'renderDay' | 'onFocusedDayChange' | 'shouldDisableDate'
>,
ExportedDateValidationProps<TDate>,
ExportedCalendarHeaderProps<TDate> {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ DesktopDateRangePicker.propTypes = {
* Disable specific date. @DateIOType
* @template TDate
* @param {TDate} day The date to test.
* @param {'start' | 'end'} position The date to test.
* @returns {boolean} Returns `true` if the date should be disabled.
*/
shouldDisableDate: PropTypes.func,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ MobileDateRangePicker.propTypes = {
* Disable specific date. @DateIOType
* @template TDate
* @param {TDate} day The date to test.
* @param {'start' | 'end'} position The date to test.
* @returns {boolean} Returns `true` if the date should be disabled.
*/
shouldDisableDate: PropTypes.func,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ StaticDateRangePicker.propTypes = {
* Disable specific date. @DateIOType
* @template TDate
* @param {TDate} day The date to test.
* @param {'start' | 'end'} position The date to test.
* @returns {boolean} Returns `true` if the date should be disabled.
*/
shouldDisableDate: PropTypes.func,
Expand Down

0 comments on commit c73f74f

Please sign in to comment.