Skip to content

Commit

Permalink
fix up date handling in desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart van den Eijnden committed Jul 18, 2014
1 parent 38dc24d commit 60e43cd
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions app/static/script/app/AsBuilt/widgets/ImagePopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ AsBuilt.ImagePopup = Ext.extend(GeoExt.Popup, {
layerName = this.layerName;
}
var editor = new Ext.ux.grid.RowEditor({saveText: 'Update'});
var dateFunc = function(value) {
if (value !== "" && value !== undefined) {
return Date.parseDate(value.substring(0, value.indexOf('Z')), 'c').format('F j, Y');
} else {
return value;
}
};
this.items = [{
xtype: "container",
layout: "vbox",
Expand Down Expand Up @@ -169,13 +176,8 @@ AsBuilt.ImagePopup = Ext.extend(GeoExt.Popup, {
meta.attr = 'style="white-space:normal"';
return value;
},
'UPDATED_DT': function(value) {
if (value !== "" && value !== undefined) {
return Date.parseDate(value, 'c').format('F j, Y, g:i a');
} else {
return value;
}
}
'UPDATED_DT': dateFunc,
'CREATED_DT': dateFunc
},
customEditors: {
'NOTE': {
Expand All @@ -189,8 +191,10 @@ AsBuilt.ImagePopup = Ext.extend(GeoExt.Popup, {
},
columnConfig: {
'UPDATED_DT': {
editable: false,
width: 0.3*this.width
editable: false
},
'CREATED_DT': {
editable: false
},
'NOTE': {
width: 0.5*this.width
Expand Down

0 comments on commit 60e43cd

Please sign in to comment.