Skip to content

Implement min and max dates in ClayDatePicker #5241

@markocikos

Description

@markocikos

What is your proposal?

Two new props for ClayDatePicker, min and max. These would be equivalents of min and max attributes of <input type="date">. Input of dates beyond this range would be disabled.

Why would adopting this proposal be beneficial?

We are using date input restriction in DXP, in commerce orders. max date is set to current date. There, we are using native date input, implemented in FDS DateRangeFilter. We would like to:

  1. implement date & time picker in FDS, that's the product requirement
  2. replace native datepicker implementation in FDS DateRangeFilter with ClayDatePicker, because Clay date & time picker has very nice UX, has consistent l&f in browsers, and has consistent l&f with other Clay components in DXP.

But, this would not be possible, without losing the min / max feature.

What are the alternatives to this proposal?

None from the perspective of Clay, we can choose not to implement this. For DXP, we can keep using native date picker, adding only ClayTimePicker for time.

/cc @dsanz @ugeortiz

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp: clay-componentsIssues related to Clay components. (e.g ClayCard, ClayLabel...)rfcSimilar to the RFC that are used in React.js, Ember.js, Gatsby.js and Rust, but to mark problems tha

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions