Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Is it possible to clear the calendar? #17

Open
DevKarenC opened this issue Jul 5, 2019 · 1 comment
Open

Is it possible to clear the calendar? #17

DevKarenC opened this issue Jul 5, 2019 · 1 comment

Comments

@DevKarenC
Copy link

I'm wondering if it's possible to clear all the times selections in the calendar. If not, I'm considering using jQuery to find and click on each of the calendar selections to delete them.

Thanks!

@trotzig
Copy link
Owner

trotzig commented Jul 11, 2019

Hi @DevKarenC 👋 - sorry for the late reply.

Right now it looks like the only way to clear everything would be to re-initialize the <AvailableTimes> component. Selections are stored in local state across a few components and it's tricky to get access to them all. But if you do something like

<AvailableTimes key={this.state.resetIncrement}>

and then somewhere else

<button onClick={() => this.setState({ resetIncrement: this.state.resetIncrement + 1  })}>Reset</button>

I think that could work. Note that this is untested code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants