DateTime Picker when editing (4.x)

388
2
06-13-2020 02:33 AM
JoshHarris
Occasional 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)
2 Replies
RobertHauck1
New Contributor

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

MKY
by
New Contributor III

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

0 Kudos