Skip to content

RFE: Add support to set your own default Picker values in addition to the current 'now' #4973

@ThomasH99

Description

@ThomasH99

Is your feature request related to a problem? Please describe.
Today, when Pickers of type PICKER_TYPE_DATE_AND_TIME and PICKER_TYPE_DATE are not initialized with a date value, the picker will always chose 'now' as the initial value (new Date()). This is good default value, but there are situations where other values are closer to what the user will want.

For example, if a task has set a due date, then a default reminder date could be 1 hour before that. And a default due date would probably rarely be now but maybe 3 or 7 days ahead in time.

To cover this, I suggest to add a method to define such a default value explicitly. Since it will often be dynamic (in the example above it will change each time the due date is changed), it would be most flexible to define a dateGetter function as in setDefaultDate(DateGetter) (DateGetter is interface Date get() or similar).

And probably also have the signature setDefaultDate(Date) to cover the simple case with a fixed default date (I guess setDefaultDate(date) could simply call setDefaultDate(()->date)).

I hope this makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions