Skip to content

SimpleDateChooser day value is always changed to 1 when month is chosen #29

@karendolan

Description

@karendolan

To duplicate:

  • set SimpleDateChoose with a date
  • just change the month/year
  • EXPECTED: only the month/year is changed
  • ACTUAL: the day of month is changed to "1"

This line always sets the days[0] instead of preferring existing day value, and only setting day[0] if no day was previously set.

https://github.com/harvard-edtech/dce-reactkit/blob/main/src/components/SimpleDateChooser.tsx#L154

This line only sets the day, and doesn't forced change the month/year like the day is being changed above.

onChange={(e) => {
// Only change the day
onChange(
month,
Number.parseInt(e.target.value, 10),
year,
);
}}
>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions