Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Provide way to quickly set year when entering DOB #2047

Closed
shubhangiagarwal76 opened this issue May 4, 2020 · 4 comments · Fixed by #2060
Closed

Provide way to quickly set year when entering DOB #2047

shubhangiagarwal76 opened this issue May 4, 2020 · 4 comments · Fixed by #2060
Assignees
Labels
🚀enhancement an issue/pull request that adds a feature to the application good first issue indicates an issue is good for a first time contributor in progress indicates that issue/pull request is currently being worked on LOE - small indicates that the level of effort to complete issue is small (i.e changing the color of a button) patients issue/pull request that interacts with patients module
Milestone

Comments

@shubhangiagarwal76
Copy link

🚀 Feature Proposal

There is no feature for selecting the year directly. Provide an arrow for switching years in DOB section.

Example

Each user will be at ease if this feature will be provided

@jackcmeyer jackcmeyer transferred this issue from HospitalRun/hospitalrun May 4, 2020
@jackcmeyer jackcmeyer added patients issue/pull request that interacts with patients module 🚀enhancement an issue/pull request that adds a feature to the application good first issue indicates an issue is good for a first time contributor help wanted indicates that an issue is open for contributions LOE - small indicates that the level of effort to complete issue is small (i.e changing the color of a button) labels May 4, 2020
@jackcmeyer jackcmeyer added this to the v2.0 milestone May 4, 2020
@jackcmeyer
Copy link
Member

jackcmeyer commented May 4, 2020

For anyone interested in working on this issue, our DateTimePicker can use the showYearDropdown prop.

@jackcmeyer jackcmeyer changed the title Selecting DOB Provide way to quickly set year when entering DOB May 4, 2020
@JDarke
Copy link
Contributor

JDarke commented May 6, 2020

I'd like to take a shot at this one, please.

@jackcmeyer
Copy link
Member

I'd like to take a shot at this one, please.

Sounds great @JDarke!

@jackcmeyer jackcmeyer added in progress indicates that issue/pull request is currently being worked on and removed help wanted indicates that an issue is open for contributions labels May 7, 2020
@JDarke
Copy link
Contributor

JDarke commented May 7, 2020

Thanks, Jack.

I've got the year dropdown to show, by passing in the showYearDropdown as true in DatePickerWithLabelFormGroup.tsx:

const DatePickerWithLabelFormGroup = (props: Props) => {
  const {
    onChange,
    label,
    name,
    isEditable,
    value,
    isRequired,
    feedback,
    isInvalid,
    maxDate,
  } = props
  const id = `${name}DatePicker`
  return (
    <div className="form-group">
      <Label text={label} htmlFor={id} isRequired={isRequired} />
      <DateTimePicker
        dateFormat="MM/dd/yyyy"
        dateFormatCalendar="LLLL yyyy"
        dropdownMode="scroll"
        maxDate={maxDate}
        selected={value}
        timeIntervals={30}
        withPortal={false}
        disabled={!isEditable}
        feedback={feedback}
        isInvalid={isInvalid}
        showYearDropdown={true}                     /*** NEW LINE ADDED ***/
        onChange={(inputDate) => {
          if (onChange) {
            onChange(inputDate)
          }
        }}
      />
    </div>
  )
}

Does this also require a new test, or is it not needed as the prop is always passed as true? (This only affects DatePicker, not DateTimePicker, so it seems right that we'd always want the year dropdown when picking a date but not a time, yes?)

JDarke added a commit to JDarke/hospitalrun-frontend that referenced this issue May 8, 2020
Added a dropdown year selector to the datepicker (used when entering patient birthdate)

re HospitalRun#2047
JDarke added a commit to JDarke/hospitalrun-frontend that referenced this issue May 9, 2020
Added a line to display the year selector dropdown on the date picker.

closes HospitalRun#2047
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚀enhancement an issue/pull request that adds a feature to the application good first issue indicates an issue is good for a first time contributor in progress indicates that issue/pull request is currently being worked on LOE - small indicates that the level of effort to complete issue is small (i.e changing the color of a button) patients issue/pull request that interacts with patients module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants