mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-10 23:45:07 +00:00
datetime and duration components now accepts value
This commit is contained in:
parent
893e2acf89
commit
b35b8e6c5f
@ -51,21 +51,21 @@ mixin statusText(build)
|
||||
span.build_info
|
||||
i.fa.fa-fw.fa-clock-o
|
||||
| finished
|
||||
DateTime(date=new Date(build.endDate))
|
||||
DateTime(value=build.endDate)
|
||||
| ,
|
||||
|
|
||||
Duration(duration=(build.endDate - build.startDate), withSuffix=true)
|
||||
Duration(value=(build.endDate - build.startDate), withSuffix=true)
|
||||
else
|
||||
if build.startDate
|
||||
span.build_info
|
||||
i.fa.fa-fw.fa-clock-o
|
||||
| started
|
||||
DateTime(date=new Date(build.startDate))
|
||||
DateTime(value=build.startDate)
|
||||
else
|
||||
span.build_info
|
||||
i.fa.fa-fw.fa-clock-o
|
||||
| queued
|
||||
DateTime(date=new Date(build.createDate))
|
||||
DateTime(value=build.createDate)
|
||||
|
|
||||
if build.scm
|
||||
span.build_info
|
||||
|
@ -61,10 +61,10 @@ div.row
|
||||
span
|
||||
if this.state.build.startDate
|
||||
span Started
|
||||
DateTime(date=new Date(this.state.build.startDate))
|
||||
DateTime(value=this.state.build.startDate)
|
||||
else
|
||||
span Queued
|
||||
DateTime(date=new Date(this.state.build.createDate))
|
||||
DateTime(value=this.state.build.createDate)
|
||||
|
||||
if this.state.build.status !== 'in-progress'
|
||||
p
|
||||
@ -72,7 +72,7 @@ div.row
|
||||
|
|
||||
| Finished
|
||||
if this.state.build.endDate
|
||||
DateTime(date=new Date(this.state.build.endDate))
|
||||
DateTime(value=this.state.build.endDate)
|
||||
else
|
||||
| -
|
||||
- var rev = this.state.build.scm && this.state.build.scm.rev || {};
|
||||
|
@ -10,9 +10,6 @@ define([
|
||||
});
|
||||
|
||||
var Component = React.createClass({
|
||||
propTypes: {
|
||||
date: React.PropTypes.instanceOf(Date)
|
||||
},
|
||||
render: template
|
||||
});
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
- var date = moment(this.props.date);
|
||||
- var date = moment(this.props.value);
|
||||
span(title= date.format())= date.fromNow()
|
||||
|
@ -1,4 +1,4 @@
|
||||
- var sec = Math.round(this.props.duration / 1000);
|
||||
- var sec = Math.round(this.props.value / 1000);
|
||||
- var min = sec >= 60 ? Math.round(sec / 60) : 0;
|
||||
- var suffix = this.props.withSuffix ? 'in ' : '';
|
||||
span(title= sec + ' sec')= suffix + (min ? min + ' min' : sec + ' sec')
|
||||
|
@ -7,15 +7,9 @@ define([
|
||||
moment: moment
|
||||
});
|
||||
|
||||
return React.createClass({
|
||||
render: template,
|
||||
getInitialState: function() {
|
||||
var seconds = Math.round(this.props.duration / 1000);
|
||||
|
||||
return {
|
||||
minutes: null,
|
||||
seconds: seconds
|
||||
}
|
||||
}
|
||||
var Component = React.createClass({
|
||||
render: template
|
||||
});
|
||||
|
||||
return Component;
|
||||
});
|
||||
|
@ -25,7 +25,7 @@
|
||||
- var lastDoneBuild = this.state.project.lastDoneBuild;
|
||||
p Last successfully built:
|
||||
if lastDoneBuild
|
||||
DateTime(date=new Date(lastDoneBuild.endDate))
|
||||
DateTime(value=lastDoneBuild.endDate)
|
||||
|
|
||||
| (build #
|
||||
span= lastDoneBuild.number
|
||||
|
Loading…
Reference in New Issue
Block a user