nci/static/js/app/components/common/duration/index.js

22 lines
393 B
JavaScript

'use strict';
define([
'react', 'templates/app/components/common/duration/index', 'moment'
], function(React, template, moment) {
template = template.locals({
moment: moment
});
return React.createClass({
render: template,
getInitialState: function() {
var seconds = Math.round(this.props.duration / 1000);
return {
minutes: null,
seconds: seconds
}
}
});
});