From 4f2ef4cf737c8d406c82a656615ba3fe6c16bf19 Mon Sep 17 00:00:00 2001
From: Carlos Martins <cmartins@expensify.com>
Date: Mon, 19 Dec 2022 12:57:18 -0700
Subject: [PATCH] rm maximumDate props

---
 src/components/DatePicker/datepickerPropTypes.js  | 4 ----
 src/components/DatePicker/index.android.js        | 1 -
 src/components/DatePicker/index.ios.js            | 1 -
 src/components/DatePicker/index.js                | 3 ---
 src/pages/EnablePayments/AdditionalDetailsStep.js | 1 -
 src/pages/ReimbursementAccount/CompanyStep.js     | 1 -
 src/pages/ReimbursementAccount/IdentityForm.js    | 1 -
 7 files changed, 12 deletions(-)

diff --git a/src/components/DatePicker/datepickerPropTypes.js b/src/components/DatePicker/datepickerPropTypes.js
index 4a681ec90c49..78db5e14d7c6 100644
--- a/src/components/DatePicker/datepickerPropTypes.js
+++ b/src/components/DatePicker/datepickerPropTypes.js
@@ -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};
diff --git a/src/components/DatePicker/index.android.js b/src/components/DatePicker/index.android.js
index 813bf517d08b..e034af725c17 100644
--- a/src/components/DatePicker/index.android.js
+++ b/src/components/DatePicker/index.android.js
@@ -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}
                     />
                 )}
             </>
diff --git a/src/components/DatePicker/index.ios.js b/src/components/DatePicker/index.ios.js
index b3badbde42c3..062134ea468d 100644
--- a/src/components/DatePicker/index.ios.js
+++ b/src/components/DatePicker/index.ios.js
@@ -116,7 +116,6 @@ class DatePicker extends React.Component {
                         themeVariant="dark"
                         onChange={this.updateLocalDate}
                         locale={this.props.preferredLocale}
-                        maximumDate={this.props.maximumDate}
                     />
                 </Popover>
             </>
diff --git a/src/components/DatePicker/index.js b/src/components/DatePicker/index.js
index 9f3c93a50605..2983ce7620b2 100644
--- a/src/components/DatePicker/index.js
+++ b/src/components/DatePicker/index.js
@@ -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));
-        }
     }
 
     /**
diff --git a/src/pages/EnablePayments/AdditionalDetailsStep.js b/src/pages/EnablePayments/AdditionalDetailsStep.js
index 1a90a8a35189..998aa93795d2 100644
--- a/src/pages/EnablePayments/AdditionalDetailsStep.js
+++ b/src/pages/EnablePayments/AdditionalDetailsStep.js
@@ -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]}
diff --git a/src/pages/ReimbursementAccount/CompanyStep.js b/src/pages/ReimbursementAccount/CompanyStep.js
index 10c2c6fdc021..6dcce7a9534d 100644
--- a/src/pages/ReimbursementAccount/CompanyStep.js
+++ b/src/pages/ReimbursementAccount/CompanyStep.js
@@ -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
                         />
diff --git a/src/pages/ReimbursementAccount/IdentityForm.js b/src/pages/ReimbursementAccount/IdentityForm.js
index 95994b73d7f8..149489d613b8 100644
--- a/src/pages/ReimbursementAccount/IdentityForm.js
+++ b/src/pages/ReimbursementAccount/IdentityForm.js
@@ -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}
