Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add ability to specify default displayed value #34

Open
matthewsanders opened this issue Jul 22, 2018 · 1 comment
Open

Feature: Add ability to specify default displayed value #34

matthewsanders opened this issue Jul 22, 2018 · 1 comment

Comments

@matthewsanders
Copy link

matthewsanders commented Jul 22, 2018

I have a use case where I need to show an empty anypicker (date) to ensure the user must select and fill it in. (so I cannot use the current selected option as that initiates the anypicker with a value).

I also need to specify a wide range of valid values (minValue, maxValue), but I need to specify a default displayed value that is somewhere between this range. Currently it is just showing the minValue in my tests.

I propose a new option for something like "defaultDisplayed" or similar.

Also note... that this default should not imply selection when the anypicker UI is displayed. (aka if you cancel it should still remain empty).

Second Request:
I also noticed there didn't seem to be a way procedurally to clear the anypicker.

@shyamzzp
Copy link

shyamzzp commented Jun 17, 2021

Yes you can specify a default displayed value.

$("#userattributesdob").AnyPicker({
                mode: "datetime",
                dateTimeFormat: "MM-dd-yyyy",
                layout: "fixed",
                theme: "iOS",
                i18n:
                {
                    headerTitle: "Date of Birth",
                    setButton: "Save"
                },
                minValue: new Date(1900, 01, 01),
                maxValue: new Date(date14YearsAgo.getFullYear(), date14YearsAgo.getMonth()+1, date14YearsAgo.getDate()),
                selectedDate: new Date(2001,01,01),
                inputElement: "#userattributesdob"
            });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants