-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(patients): max DOB set for current date #1985
Conversation
Added maxDate prop to DatePicker component to avoid DOB being set in the future.
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/hospitalrun/hospitalrun-frontend/nrs0sriwn |
This also partially Fixes #1976 regarding the date of birth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jlato89!
Few changes requested:
- address comment
- add test to show that
DatePickerWithLabelFormGroup
passes maxDate value toDateTimePicker
from@hospitalrun/components
- add test to show that
GenrealInformation
component sets the max date value to the current day
Please let me now if you need any help! Would love to work through this with you 👍
@@ -22,6 +23,7 @@ const DatePickerWithLabelFormGroup = (props: Props) => { | |||
dateFormat="MM/dd/yyyy" | |||
dateFormatCalendar="LLLL yyyy" | |||
dropdownMode="scroll" | |||
maxDate={addDays(new Date(), 0)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component is intended to be more general than for use inside of the new/edit patient screen.
I think that this interface will only need to expose an optional maxDate and just pass it along to the DateTimePicker from
@hopsitalrun/components`.
Then we'll need to make a change in the GenrealInformationComponent
to set the maxDate
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree 100% with your vision. @jlato89 can you handle it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should be able to yes. just an oversight on my part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @jackcmeyer on proposed changes.
I had a feeling it was but couldn't find another instance of it being used.
Will work on those changes. Tests might take a bit longer as I havnt done
them before but I'm sure il figure it out.
…On April 14, 2020 8:10:51 AM Jack Meyer ***@***.***> wrote:
@jackcmeyer requested changes on this pull request.
Hi @jlato89!
Few changes requested:
address comment
add test to show that DatePickerWithLabelFormGroup passes maxDate value to
DateTimePicker from @hospitalrun/components
add test to show that GenrealInformation component sets the max date value
to the current day
In src/components/input/DatePickerWithLabelFormGroup.tsx:
> @@ -22,6 +23,7 @@ const DatePickerWithLabelFormGroup = (props: Props) => {
> dateFormat="MM/dd/yyyy" dateFormatCalendar="LLLL yyyy" dropdownMode="scroll"
+ maxDate={addDays(new Date(), 0)}
This component is intended to be more general than for use inside of the
new/edit patient screen.
I think that this interface will only need to expose an optional maxDate
and just pass it along to the DateTimePicker from @hopsitalrun/components`.
Then we'll need to make a change in the GenrealInformationComponent to set
the maxDate property.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Added maxDate prop to DatePicker component to avoid DOB being set in the future. fix HospitalRun#1985
Added the appropriate changes. Just have to figure out how todo the tests. Then it will be ready to be merged. |
Deployment failed with the following error:
|
closing in favor of #2002 |
Added maxDate prop to DatePicker component to avoid DOB being set in the future.
Fixes #1984.
Changes proposed in this pull request:
Newly added dependencies with Bundlephobia links: