AC-175 Job event details -show date in local timezone and with a cleaner format

This commit is contained in:
chouseknecht 2013-07-01 12:11:44 -04:00
parent 5ead7b7ec4
commit e17d984758
2 changed files with 23 additions and 8 deletions

View File

@ -145,7 +145,7 @@ JobEventsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routePa
];
function JobEventsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, JobEventForm, GenerateForm,
Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath)
Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath, FormatDate)
{
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
//scope.
@ -172,8 +172,14 @@ function JobEventsEdit ($scope, $rootScope, $compile, $location, $log, $routePar
scope['event_data'] = JSON.stringify(data['event_data'], undefined, '\t');
}
else {
if (data[fld]) {
scope[fld] = data[fld];
if (fld == 'created') {
var cDate = new Date(data['created']);
scope['created'] = FormatDate(cDate);
}
else {
if (data[fld]) {
scope[fld] = data[fld];
}
}
}
}
@ -186,4 +192,6 @@ function JobEventsEdit ($scope, $rootScope, $compile, $location, $log, $routePar
}
JobEventsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobEventForm',
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath'];
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath',
'FormatDate'
];

View File

@ -8,8 +8,9 @@
*/
angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefinition'])
.factory('EventView', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventForm', 'GenerateForm',
'Prompt', 'ProcessErrors', 'GetBasePath',
function($rootScope, $location, $log, $routeParams, Rest, Alert, JobEventForm, GenerateForm, Prompt, ProcessErrors, GetBasePath) {
'Prompt', 'ProcessErrors', 'GetBasePath', 'FormatDate',
function($rootScope, $location, $log, $routeParams, Rest, Alert, JobEventForm, GenerateForm, Prompt, ProcessErrors, GetBasePath,
FormatDate) {
return function(params) {
var event_id = params.event_id;
var generator = GenerateForm;
@ -49,8 +50,14 @@ angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefini
scope['event_display'] = data.event_display.replace(/^\u00a0*/g,'')
}
else {
if (data[fld]) {
scope[fld] = data[fld];
if (fld == 'created') {
var cDate = new Date(data['created']);
scope['created'] = FormatDate(cDate);
}
else {
if (data[fld]) {
scope[fld] = data[fld];
}
}
}
}