Skip to content

Multiple DateTimeRangeContainers #65

Description

@shanestreator

It'd be nice to be able to define a id property on DateTimeRangeContainer.
All associated actions/values would be bound to the defined id.

<DateTimeRangeContainer id="daterangepicker-1" />
<DateTimeRangeContainer id="daterangepicker-2" />
<DateTimeRangeContainer id="daterangepicker-3" />

Is this a potentially quick feature to implement?

Attempted workaround scenario:

// Successfully mutating the id onMount
useEffect(() => {
        document.querySelector(`.${props.name} .daterangepicker`).setAttribute('id', `${props.name}`)
}, [props])

render (
    <div className={`input-group ${props.name}`}> 
        // QTY 2 ========== (id and class for calendar by default is "daterangepicker")
        <DateTimeRangeContainer> <Form.Control /> </DateTimeRangeContainer> 
        <DateTimeRangeContainer> <Form.Control /> </DateTimeRangeContainer> 
    </div>
)

The [2nd DateTimeRangeContainer] with a unique id updates the [1st DateTimeRangeContainer].

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions