AnyPicker
AnyPicker copied to clipboard
Feature: Add ability to specify default displayed value
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.
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"
});