Soulscode
Soulscode
SSolara
Created by Cold Sunshine on 7/8/2024 in #questions-issues
InputDateRange question
Or even populating the second value with the same date as the first to make a single date range, but maintains the two item tuple.
13 replies
SSolara
Created by Cold Sunshine on 7/8/2024 in #questions-issues
InputDateRange question
That makes me wonder if there's a feature request or something in there to have the InputDateRange component write the tuple as a two item on the first selection, with the second as a None or something until the second date is populated.
13 replies
SSolara
Created by Cold Sunshine on 7/8/2024 in #questions-issues
InputDateRange question
Tweaked slightly from yours because pycafe didn't like pendulum.
13 replies
SSolara
Created by Cold Sunshine on 7/8/2024 in #questions-issues
InputDateRange question
So, the reason the documented example works and yours doesn't is that in the example they aren't splitting the tuple. In yours, because you're splitting it, when you select the first date, the reactive tuple updates from (<date-7>, <date>), to (<date>), that update causes the component it's associated with to refresh, and your calling of index 1 is out of range. Here's my version in pycafe. https://app.py.cafe/soulscode/solara-date-range-viewer I put a couple of ways I thought of to get around that in there.
13 replies
SSolara
Created by Cold Sunshine on 7/8/2024 in #questions-issues
InputDateRange question
Nope, I'm wrong. Had a chance to test, and the view is refreshing before you can select the end date(at least on my pycafe test), so there's only one entry in the tuple.
13 replies
SSolara
Created by Cold Sunshine on 7/8/2024 in #questions-issues
InputDateRange question
I haven't run the code, but I think your tuple assignment to date_range is to blame. You're creating a tuple with a single item which is a list of two items, which is why date_range.value[1] is out of range. I think changing it to this should work(again, untested): date_range = solara.use_reactive((end_date.subtract(days=7), end_date)) Alternatively I think just removing the [] in that same line might also work, all of this presuming you need this to be a tuple.
13 replies
SSolara
Created by Soulscode on 3/13/2024 in #questions-issues
Can't cancel running @task?
Code was to big for the character limit, threw it into a gist. https://gist.github.com/Enochsoul/3ead6207477bc3e3b7add173318099a6
3 replies
SSolara
Created by Soulscode on 2/22/2024 in #questions-issues
Conditional Hook issues
Actually, I just found the solution. I was trying to filter the source data itself, instead of applying the filtering to the UI elements based on the data. React noobishness I'm presuming. 8D
3 replies