I’m using F7 v3.6.7 and app.picker.get(el); always returns undefined. For example, the last line in the code below always shows “undefined”.
// Check if picker already exists
var timePicker = app.picker.get(selector_name);
console.log(timePicker);
if (timePicker === undefined) {
timePicker = app.picker.create({
inputEl: selector_name,
rotateEffect: true,
formatValue: function (values, displayValues) {
return displayValues[0] + ':' + values[1];
},
cols: [
// Minutes
{
values: (function () {
var arr = [];
for (var i = 0; i <= 59; i++) {
arr.push(i);
}
return arr;
})()
},
// Divider
{
divider: true,
content: ':'
},
// Seconds
{
values: (function () {
var arr = [];
for (var i = 0; i <= 59; i++) {
arr.push(i < 10 ? '0' + i : i);
}
return arr;
})()
}
]
});
}
console.log(app.picker.get(selector_name));