deseretdigital/dayzed

Changing offset with state

anubra266 opened this issue · 2 comments

How could I handle the moth offset when the selected state changes. E.g. If I change the selected state from an input to a date in June, I want to move the calendar from Janury to June.

Thanks

Here is an example of how you could do this around line 150 - https://codesandbox.io/s/dayzed-select-dropdown-example-5jrc4?file=/src/Single.js

You can use the date, offset, and onOffsetChanged props to control what dates are currently being displayed. The example uses select elements but you could also accomplish this by parsing a string from a text input and then updating the date and offset props accordingly if a valid date string is provided.

Hopefully that is helpful. Let me know if that doesn't answer the question. Thanks!

It does...thanks @mkartchner994