This is a first pass at a DateRangePicker as described in #255.
To see it in action, open the src/DateRangePicker.jl notebook.
I wanted something that behaved like this:
Lets the user select a start and end date
Returns the range from the start to end date (a StepRange with step of one day)
Needs both dates to be set (i.e. no ranges going to Inf because StepRange doesn't support that) and the start date to be <= the end date.
It's not fully working yet. I have used transformed_value, as in ScrubbableMatrix, to build a DateRangePicker out of two DatePickers. But this causes problems when the range isn't valid (e.g. if no default range is set). There are some assertions for validation in the inner function of transformed_value, but transformed_value turns these into its own error tuple, which bubbles up to the bound value itself. So a default DateRangePicker() returns an error tuple instead of nothing, which doesn't feel right to me:
The error logging above also doesn't disappear when a correct range is entered. I'll experiment; maybe I need to log an @error and return nothing instead of using @assert in the inner function.
This is a first pass at a
DateRangePicker
as described in #255.To see it in action, open the
src/DateRangePicker.jl
notebook.I wanted something that behaved like this:
It's not fully working yet. I have used
transformed_value
, as in ScrubbableMatrix, to build aDateRangePicker
out of twoDatePicker
s. But this causes problems when the range isn't valid (e.g. if no default range is set). There are some assertions for validation in the inner function of transformed_value, but transformed_value turns these into its own error tuple, which bubbles up to the bound value itself. So a defaultDateRangePicker()
returns an error tuple instead ofnothing
, which doesn't feel right to me:The error logging above also doesn't disappear when a correct range is entered. I'll experiment; maybe I need to log an
@error
and return nothing instead of using@assert
in the inner function.Addresses #255