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

Commit

Permalink
Add an offset for epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Gorman committed May 5, 2016
1 parent 31260ef commit 909a64a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/components/dashboard/job_last_10.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ import _ from 'lodash';
import JobsStoreHEC from '../../jobs/hec'
import moment from 'moment';
import gen_path from '../../path_utils';
import store from '../../store';


class JobGroupItem extends React.Component {
render() {
let job_id = this.props.job_id;
let job = this.props.job;
let link = `/job_result/${job_id}`;
let settings = store.get('settings')
return (
<li key={job_id} className="list-group-item">
<span className="badge">{moment.unix(job.StartTime).fromNow()}</span>
<span className="badge">{moment.unix(job.StartTime - settings.OFFSET).fromNow()}</span>
<i className="fa fa-calendar" /> <Link to={gen_path(link)}>[{job_id}] {job.Function} on "{job.Target}"</Link>
</li>
)
Expand Down
4 changes: 3 additions & 1 deletion app/components/job_history.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {ReactBootstrapTableStyle} from '../../node_modules/react-bootstrap-table
import moment from 'moment';
import { Link } from 'react-router';
import gen_path from '../path_utils';
import store from '../store';

class JobHistory extends React.Component {
render() {
Expand All @@ -19,7 +20,8 @@ class JobHistory extends React.Component {
}

function DateFormatter(job_start_time, job){
return moment.unix(job_start_time).calendar();
let settings = store.get('settings')
return moment.unix(job_start_time - settings.OFFSET).calendar();
}

function JidOutputLink(jid, job){
Expand Down
1 change: 1 addition & 0 deletions settings.json.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"API_URL": "localhost:5417", # The API URL
"SECURE_HTTP": false, # Is the API protected by HTTPS?
"OFFSET": 0, # This is the offset in epoch(seconds)
"templates": { # Templates sample
"basic": { # Template name
"description": "Basic template", # Template description
Expand Down

0 comments on commit 909a64a

Please sign in to comment.