Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow future dates to be entered in DatePicker #13702

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/components/DatePicker/datepickerPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ const propTypes = {
* `onInputChange` would always be called with a Date (or null)
*/
defaultValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string]),

/* Restricts for selectable max date range for the picker */
maximumDate: PropTypes.instanceOf(Date),
};

const defaultProps = {
...defaultFieldPropTypes,
value: undefined,
maximumDate: undefined,
};

export {propTypes, defaultProps};
1 change: 0 additions & 1 deletion src/components/DatePicker/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class DatePicker extends React.Component {
value={this.props.value || this.props.defaultValue ? moment(this.props.value || this.props.defaultValue).toDate() : new Date()}
mode="date"
onChange={this.setDate}
maximumDate={this.props.maximumDate}
/>
)}
</>
Expand Down
1 change: 0 additions & 1 deletion src/components/DatePicker/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class DatePicker extends React.Component {
themeVariant="dark"
onChange={this.updateLocalDate}
locale={this.props.preferredLocale}
maximumDate={this.props.maximumDate}
/>
</Popover>
</>
Expand Down
3 changes: 0 additions & 3 deletions src/components/DatePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ class DatePicker extends React.Component {
// Adds nice native datepicker on web/desktop. Not possible to set this through props
this.inputRef.setAttribute('type', 'date');
this.inputRef.classList.add('expensify-datepicker');
if (this.props.maximumDate) {
this.inputRef.setAttribute('max', moment(this.props.maximumDate).format(CONST.DATE.MOMENT_FORMAT_STRING));
}
Luke9389 marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/pages/EnablePayments/AdditionalDetailsStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ class AdditionalDetailsStep extends React.Component {
defaultValue={this.props.walletAdditionalDetailsDraft.dob || ''}
placeholder={this.props.translate('common.dob')}
errorText={this.getErrorText('dob') || this.getErrorText('age')}
maximumDate={new Date()}
/>
<TextInput
containerStyles={[styles.mt4]}
Expand Down
1 change: 0 additions & 1 deletion src/pages/ReimbursementAccount/CompanyStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ class CompanyStep extends React.Component {
inputID="incorporationDate"
label={this.props.translate('companyStep.incorporationDate')}
placeholder={this.props.translate('companyStep.incorporationDatePlaceholder')}
maximumDate={new Date()}
defaultValue={ReimbursementAccountUtils.getDefaultStateForField(this.props, 'incorporationDate')}
shouldSaveDraft
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/ReimbursementAccount/IdentityForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ const IdentityForm = (props) => {
defaultValue={props.values.dob || props.defaultValues.dob}
onInputChange={value => props.onFieldChange({dob: value})}
errorText={dobErrorText}
maximumDate={new Date()}
/>
<TextInput
inputID={props.inputKeys.ssnLast4}
Expand Down