Hi I have a feature layer that i add through the Add data widget however the time isn't showing in the attribute table. I can see it in the popup however.
Can anyone advise what needs to be done?
Victor,
You will have to edit the jimu/utils.js mo.getDefaultPortalFieldInfo function.
//return {fieldName,label,tooltip,visible,format,stringFieldOption} mo.getDefaultPortalFieldInfo = function(serviceFieldInfo){ //serviceFieldInfo: {name,alias,type,...} var fieldName = serviceFieldInfo.name; var item = { fieldName: fieldName, label: serviceFieldInfo.alias || fieldName, tooltip: '', visible: false, format: null, stringFieldOption: 'textbox' }; //https://developers.arcgis.com/javascript/jsapi/field-amd.html#type var type = serviceFieldInfo.type; switch (type) { case 'esriFieldTypeSmallInteger': case 'esriFieldTypeInteger': item.format = { places: 0, digitSeparator: true }; break; case 'esriFieldTypeSingle': case 'esriFieldTypeDouble': item.format = { places: 2, digitSeparator: true }; break; case 'esriFieldTypeDate': item.format = { dateFormat: "longMonthDayYearLongTime" }; break; } return item; };
Notice I have added LongTime to the dateFormat.
Unfortunately I don't see a way around it either.
Thanks Robert. Not ideal as I am using build in webappbuilder with OOTB attribute widget 😞 but I don't see anyway around this.
Cheers
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.