Skip to content

Commit

Permalink
fix: rename calendarMaxMoment to calendarMax
Browse files Browse the repository at this point in the history
  • Loading branch information
alaa-yahia committed Jan 6, 2025
1 parent e8d226f commit 8ce68dd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const getDateFieldConfig = (metaData: DateDataElement, options: Object, q
maxWidth: options.formHorizontal ? 150 : 350,
calendarWidth: options.formHorizontal ? 250 : 350,
popupAnchorPosition: getCalendarAnchorPosition(options.formHorizontal),
calendarMaxMoment: !metaData.allowFutureDate ? convertDateObjectToDateFormatString(moment()) : undefined,
calendarMax: !metaData.allowFutureDate ? convertDateObjectToDateFormatString(moment()) : undefined,
}, options, metaData);

return createFieldConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const getDateFieldConfigForCustomForm = (metaData: DateDataElement, optio
width: 350,
maxWidth: 350,
calendarWidth: 350,
calendarMaxMoment: !metaData.allowFutureDate ? convertDateObjectToDateFormatString(moment()) : undefined,
calendarMax: !metaData.allowFutureDate ? convertDateObjectToDateFormatString(moment()) : undefined,
}, metaData);

return createFieldConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const getEnrollmentDateSettings = () => {
required: true,
calendarWidth: props.formHorizontal ? 250 : 350,
popupAnchorPosition: getCalendarAnchorPosition(props.formHorizontal),
calendarMaxMoment: !props.enrollmentMetadata.allowFutureEnrollmentDate ? convertDateObjectToDateFormatString(moment()) : undefined,
calendarMax: !props.enrollmentMetadata.allowFutureEnrollmentDate ? convertDateObjectToDateFormatString(moment()) : undefined,
}),
getPropName: () => 'enrolledAt',
getValidatorContainers: getEnrollmentDateValidatorContainer,
Expand Down Expand Up @@ -160,7 +160,7 @@ const getIncidentDateSettings = () => {
required: true,
calendarWidth: props.formHorizontal ? 250 : 350,
popupAnchorPosition: getCalendarAnchorPosition(props.formHorizontal),
calendarMaxMoment: !props.enrollmentMetadata.allowFutureIncidentDate ?
calendarMax: !props.enrollmentMetadata.allowFutureIncidentDate ?
convertDateObjectToDateFormatString(moment()) :
undefined,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Props = {
onDateSelectedFromCalendar?: () => void,
placeholder?: string,
label?: string,
calendarMaxMoment?: any,
calendarMax?: any,
innerMessage?: any
};

Expand Down Expand Up @@ -61,11 +61,11 @@ export class DateField extends React.Component<Props, State> {
maxWidth,
calendarWidth,
inputWidth,
calendarMaxMoment,
calendarMax,
value,
innerMessage,
} = this.props;

console.log(calendarMax,"calendarMax")
const calculatedInputWidth = inputWidth || width;
const calculatedCalendarWidth = calendarWidth || width;
const calendarType = systemSettingsStore.get().calendar || 'gregory';
Expand Down Expand Up @@ -94,7 +94,7 @@ export class DateField extends React.Component<Props, State> {
onFocus={this.props.onFocus}
disabled={this.props.disabled}
{...errorProps}
maxDate={calendarMaxMoment}
maxDate={calendarMax}
/>
</div>
);
Expand Down

0 comments on commit 8ce68dd

Please sign in to comment.