-
Notifications
You must be signed in to change notification settings - Fork 184
Feature Request: InputDate/InputDateRange enhancements #653
Description
Overview
I'd like to propose some enhancements to the InputDate and InputDateRange controls.
Support for a monthly date resolution
With many reporting applications, it is common to be interested in monthly data. The InputDate and InputDateRange components can support this, but the end-user needs to pick the date at the daily granularity (e.g., by picking the first of the month). This could be confusing for monthly use cases, because it may not be clear if the end-user needs to pick the first of the month, or if they could pick any day in the month (e.g., where the application could truncate/ignore the day-component of the date).
Proposed enhancement: add a date_picker_type parameter to let the developer specify whether the date picker should use daily granularity (the default) or monthly granularity. The solara.v.DatePicker accepts a type parameter that supports a monthly granularity (by specifying type='month'), so this parameter would map directly to that one.
Support for controlling the min/max allowed dates
By default, the InputDate and InputDateRange place no bounds on the allowed dates that the end-user can select. It would be desirable for the developer to be able to limit this range -- perhaps to the range where there is data, or perhaps to limit the end-user from selecting dates too far in the future or past.
Proposed enhancement: add min_date and max_date parameters to allow the developer to place limits on the allowed dates. The solara.v.DatePicker accepts min and max parameters that provide this level of control, so these new parameters would map directly to those.
Support for automatically sorting dates (InputDateRange only)
By default, the InputDateRange control does not order the dates that are picked. If the end-user selects a more recent date as the first date and an older date as the second, the dates will be ordered in that same way. I would hazard a guess that most of the time, end-users (and developers) would prefer the dates to be sorted from oldest to newest, regardless of which order they are selected, or at least that the order would be controlled, rather than based on the order they are clicked.
Proposed enhancement: add an optional ascending parameter to allow the developer to automatically sort the dates chosen with the InputDateRange:
None(the default) would preserve the current behavior (i.e., not sorted)Truewould sort ascendingFalsewould sort descending