Skip to content

[EuiSuperDatePicker] Allow only certain range of dates #6021

Closed

Description

@vvvprabhakar

In EuiSuperDatePicker, there is no option to allow user to select certain range of dates

for example, if I want to select date range of the last seven days only? How will i do it

Activity

  1. chandlerprall commented on Jul 5, 2022

    @chandlerprall
    Contributor

    This is not supported currently.

    For the Absolute panel, it should be a straight forward add as we can forward minDate & maxDate values to the underlying datepicker control.

    Gets trickier with Relative options, we have an error state for invalid inputs (e.g. negative numbers) and could do something similar if the selected relative range is invalid. This leads to the question of what an invalid relative range is: does the entire range need to fall in the date range or is only an overlap okay.

    Similar question with the Now tab, should it go away if the present datetime is excluded, add a message & disable the Set button, or something else?

    Perhaps I'm over complicating this, and only the modification to Absolute is necessary as it could be a UX-addictive thing that exists more to help guide a user than anything else. If so, we could allow a pass-through prop targeting the absolute tab's EuiDatePicker.

  2. added
    ⚠️ needs validation
    on Jul 5, 2022
  3. chandlerprall commented on Jul 7, 2022

    @chandlerprall
    Contributor

    @vvvprabhakar is the ability to control the selectable dates in the Absolute tab enough, or would you require the other date selection tabs to interact with the limited range?

  4. vvvprabhakar commented on Jul 10, 2022

    @vvvprabhakar
    Author

    What I am thinking is,
    If users need to be restricted to select for only some 'X' days,
    If we have a property like minDate and maxDate it would be super helpful

    This would be very helpful in kibana/opensearchDashboard time filter on the discover page

    Where if we are able to make that time range configurable via config options and SuperDatePicker take that range

  5. vvvprabhakar commented on Jul 10, 2022

    @vvvprabhakar
    Author

    if you want i will come up with a PR

  6. vvvprabhakar commented on Jul 10, 2022

    @vvvprabhakar
    Author

    As we implemented invalid date, the same way we can also implement the raneg

  7. chandlerprall commented on Jul 20, 2022

    @chandlerprall
    Contributor

    Adding minDate / maxDate at the top level API for EuiSuperDatePicker, using them in the Absolute panel, and adding validation in isRangeInvalid sounds like a good approach.

    if you want i will come up with a PR

    Please do! If you want any help or pointers feel free to ask, that code is bit of a web.

  8. github-actions commented on Jan 17, 2023

    @github-actions

    👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

  9. added
    stale-issue
    on Jan 17, 2023
  10. github-actions commented on Jan 24, 2023

    @github-actions

    ❌ We're automatically closing this issue due to lack of activity. Please comment if you feel this was done in error.

  11. added
    stale-issue-closed
    on Jan 24, 2023
  12. self-assigned this
    on Oct 10, 2024
  13. removed
    stale-issue-closed
    stale-issue
    on Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

⚠️ needs validation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions