1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-23 15:58:49 -05:00

add moment to format date

This commit is contained in:
Tankred Hase 2013-09-05 10:59:55 +02:00
parent 6d3f7dcd47
commit e93407f478
4 changed files with 25 additions and 10 deletions

View File

@ -1,7 +1,8 @@
define(function(require) {
'use strict';
var appController = require('js/app-controller');
var appController = require('js/app-controller'),
moment = require('moment');
var MessageListCtrl = function($scope) {
$scope.folderName = 'Inbox';
@ -10,12 +11,7 @@ define(function(require) {
$scope.selected = email;
};
fetchList(function(err, emails) {
if (err) {
console.log(err);
return;
}
fetchList(function(emails) {
$scope.emails = emails;
$scope.$apply();
});
@ -32,7 +28,19 @@ define(function(require) {
folder: 'INBOX',
offset: -6,
num: 0
}, callback);
}, function(err, emails) {
if (err) {
console.log(err);
return;
}
emails.forEach(function(email) {
// set display date
email.displayDate = moment(email.sentDate).format('DD.MM.YY');
});
callback(emails);
});
});
}

6
src/lib/moment.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,8 @@
SmtpClient: 'smtp-client-browserified',
angular: 'angular/angular.min',
angularRoute: 'angular/angular-route.min',
angularTouch: 'angular/angular-touch.min'
angularTouch: 'angular/angular-touch.min',
moment: 'moment.min'
},
shim: {
angular: {

View File

@ -16,7 +16,7 @@
<p class="from">{{email.from[0].name}}</p>
<p class="subject-line">
<span class="subject">{{email.subject}}</span>
<span class="sent-date">{{email.sentDate}}</span>
<span class="sent-date">{{email.displayDate}}</span>
</p>
<p class="text-preview">{{email.body}}</p>
</li>