1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 07:01:12 +00:00

Improve Moment related code

This commit is contained in:
Daniel Pan
2016-03-17 11:15:28 +08:00
parent 99e8c1c99d
commit 2ac6a8859c
3 changed files with 16 additions and 15 deletions

View File

@@ -3,7 +3,8 @@ define([
'underscore',
'backbone',
'common',
], function($, _, Backbone, Common) {
'moment'
], function($, _, Backbone, Common, Moment) {
'use strict';
var DeviceView = Backbone.View.extend({
@@ -43,7 +44,7 @@ define([
// convert to human readable time
var now = new Date(),
last_accessed = Common.getMomentWithLocale(data['last_accessed']);
last_accessed = Moment(data['last_accessed']);
data['time'] = last_accessed.format('LLLL');
if (last_accessed - now > 0) {