Select to view content in your preferred language

DateTime Picker when editing (4.x)

1090
3
06-13-2020 02:33 AM
RonParis
Frequent Contributor

I have a js app that is utilising the editor widget for a number of feature layers. These feature layers have datetime fields, which need to be filled in by users. The default config for these fields when using the js app, is a free text field (image below).

My question is how do I make these date fields display as a DateTime Picker when editing?

Code sample:

view.map.layers.forEach(function(layer) {
if (layer.title === "Point Features") {
editConfigPointLayer = {
layer: layer,
// Set it so that only one field displays within the form
fieldConfig: [
{
name: 'tier',
label: 'Tier'
},
{
name: 'delivery_phase',
label: 'Delivery Phase'
},
{
name: 'date_insta',
label: 'Date Installed'
},
{
name: 'prop_imple',
label: 'Proposed Implementation Date'
}
]
};
}

}); 

// Create the Editor
let editor = new Editor({
view: view,
// Pass in the configurations created above
layerInfos: [editConfigLinearLayer, editConfigPointLayer,editConfigPolygonLayer],
// Override the default template behavior of the Editor widget
supportingWidgetDefaults: {
featureTemplates: {
groupBy: customGroup
}
}
});

DateTime field - editing

Tags (3)
3 Replies
RobertHauck1
Emerging Contributor

Did you have any luck getting date / time pickers to work with the 4.x edit widget?

MKY
by
Occasional Contributor

DateTime picker is not working in 4.20 when editing. Any plans for 4.21? 

0 Kudos
DvirusG
New Contributor

Maybe 4.22, 4.23,4.24,4.25 ?!?

no... 😕

0 Kudos