summaryrefslogtreecommitdiff
path: root/web-ui/app/js/page/version.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/app/js/page/version.js')
-rw-r--r--web-ui/app/js/page/version.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/web-ui/app/js/page/version.js b/web-ui/app/js/page/version.js
index e5299f52..9fd5e629 100644
--- a/web-ui/app/js/page/version.js
+++ b/web-ui/app/js/page/version.js
@@ -14,13 +14,23 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-define(['flight/lib/component', 'views/templates'], function (defineComponent, templates) {
+define(['flight/lib/component', 'views/templates', 'helpers/view_helper'], function (defineComponent, templates, viewHelper) {
'use strict';
return defineComponent(function () {
-
+ this.defaultAttrs({
+ 'sinceDate': '#version-date'
+ });
+
this.render = function () {
this.$node.html(templates.page.version());
+ this.renderCommitDate();
+ };
+
+ this.renderCommitDate = function(){
+ var since = this.select('sinceDate').attr('data-since'),
+ commitDate = viewHelper.sinceDate(since);
+ this.select('sinceDate').html(commitDate + ' ago');
};
this.after('initialize', function () {