Open akrulec opened 3 weeks ago
How is currentDate
being updated? There's an example in the sample app with month/week toggle and this seems to work fine. Can you reproduce it there?
How is
currentDate
being updated? There's an example in the sample app with month/week toggle and this seems to work fine. Can you reproduce it there?
Is there a specific case I should try to reproduce this on? I haven't found any examples that would keep the 'current date' state in the view model. Thanks
https://github.com/kizitonwose/Calendar/blob/64b7adbce7c6c7581895575a359fcc8e5d188416/compose-multiplatform/sample/src/commonMain/kotlin/Utils.kt#L123
I've tried using this function the following way. The goal is that if the user scrolls the week calendar, we automatically select the same day in the week the user scrolled to. Then we update the screen below the week calendar.
However, we also at some point show a full calendar, and when the user select the date there, we use
scrollToWeek
function to scroll the calendar to that week.However, if the user scolls way back ( to like a year ago), and selects a date, the
visibleWeek
is not correct. Printing the values this is what I get:The side effect of this odd state seems to be the following. If the user clicks 'today' button, the visible week seems to be at some random date in 2021:
Any idea what could be going on here? Is there something in the state that needs to be updated? I assume that if
currentDate
is updated, thenrememberWeekCalendarState
will refresh, but maybe not?Thank you!