StippleUI.jl icon indicating copy to clipboard operation
StippleUI.jl copied to clipboard

DateRange is not syncronized to the backend

Open ValentinKaisermayer opened this issue 2 years ago • 8 comments

using Stipple, StippleUI

@reactive mutable struct DatePickers <: ReactiveModel
    date::R{Date} = today() + Day(30)
    daterange::R{DateRange} = DateRange(today(), (today() + Day(3)))
end

function ui(model)
  [
    page(
      model,
      class = "container",
      title = "Bug",
      partial = true,
      core_theme = true,
      [
        row(cell([h1("Date picker")]))
        row(
          [
            cell([
                datepicker(:date), 
            ])
            cell([
                datepicker(:daterange, range = true),
            ])
          ],
        )
      ],
    ),
  ]
end

model = DatePickers |> init

route("/") do
    html(ui(model), context = @__MODULE__)
end

up()

Changing the date range via the REPL updates the view model.daterange[] = DateRange(Date("2022-07-01"), Date("2022-07-05")) but the other way around does not work model.daterange[].

  [c43c736e] Genie v4.18.1
  [4acbeb90] Stipple v0.24.4
  [ec984513] StipplePlotly v0.12.4
  [a3c5d34a] StippleUI v0.19.4

ValentinKaisermayer avatar Jul 19 '22 07:07 ValentinKaisermayer