Skip to content
This repository was archived by the owner on Feb 18, 2021. It is now read-only.

Commit 5fe289d

Browse files
author
Michael Gorman
committed
Add an offset for epoch
1 parent 31260ef commit 5fe289d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

app/components/dashboard/job_last_10.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ import _ from 'lodash';
44
import JobsStoreHEC from '../../jobs/hec'
55
import moment from 'moment';
66
import gen_path from '../../path_utils';
7+
import store from '../store';
78

89

910
class JobGroupItem extends React.Component {
1011
render() {
1112
let job_id = this.props.job_id;
1213
let job = this.props.job;
1314
let link = `/job_result/${job_id}`;
15+
let settings = store.get('settings')
1416
return (
1517
<li key={job_id} className="list-group-item">
16-
<span className="badge">{moment.unix(job.StartTime).fromNow()}</span>
18+
<span className="badge">{moment.unix(job.StartTime - settings.OFFSET).fromNow()}</span>
1719
<i className="fa fa-calendar" /> <Link to={gen_path(link)}>[{job_id}] {job.Function} on "{job.Target}"</Link>
1820
</li>
1921
)

app/components/job_history.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {ReactBootstrapTableStyle} from '../../node_modules/react-bootstrap-table
66
import moment from 'moment';
77
import { Link } from 'react-router';
88
import gen_path from '../path_utils';
9+
import store from '../store';
910

1011
class JobHistory extends React.Component {
1112
render() {
@@ -19,7 +20,8 @@ class JobHistory extends React.Component {
1920
}
2021

2122
function DateFormatter(job_start_time, job){
22-
return moment.unix(job_start_time).calendar();
23+
let settings = store.get('settings')
24+
return moment.unix(job_start_time - settings.OFFSET).calendar();
2325
}
2426

2527
function JidOutputLink(jid, job){

settings.json.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"API_URL": "localhost:5417", # The API URL
33
"SECURE_HTTP": false, # Is the API protected by HTTPS?
4+
"OFFSET": 0, # This is the offset in epoch(seconds)
45
"templates": { # Templates sample
56
"basic": { # Template name
67
"description": "Basic template", # Template description

0 commit comments

Comments
 (0)