Related Table format Display name if Date
We have been doing a lot of web editing applications with related tables showing treatments, assessments, and things like that and we use the date of inspection as the display name for the related table. However, when displayed in Geocortex for HTML5, it shows that date in UNIX time for example: 143021148200 instead of Apr 28, 2015 04:58:02. I was wondering if this could be formatted the same way that the attributes of the feature and related table attributes display the datetime field. This way at a glance our users can tell when they last inspected a site or treated an invasive species for example. The unix number does nothing for them and they would really like to see the date.
I don't know how elegant this is, but in Resources\Compiled\Mapping.js, I changed the method 'a.prototype._processRelatedFeature = function(a, h, b) ' from
a.prototype._processRelatedFeature = function(a, h, b) {
var e = new ObservableCollection,
d = h.attributes[a.displayName];
d || (d = h.attributes[a.objectIdField]);
return...
to:
a.prototype._processRelatedFeature = function(a, h, b) {
var dateString;
var e = this._getAttributeTypes(a);
if (h)
for (var d in h) {
if (d == "attributes") {
var g = h[d];
e[a.displayField] === "esriFieldTypeDate" && g[a.displayField] && (dateString = this._formatDate(g[a.displayField]));
}
}
var e = new ObservableCollection,
d = dateString;
d || (d = h.attributes[a.objectIdField]);
return...
Du måste logga in om du vill lämna en kommentar.
Kommentarer
0 kommentarer