Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed #27

  • Loading branch information...
commit e528be9c88552166d3d5d189018c7598a04cb98e 1 parent 4a979c8
@alswl authored
View
1  bower.json
@@ -11,6 +11,7 @@
"angular-resource": "*",
"ngQuickDate": "~1.2.0",
"momentjs": "~2.5.1",
+ "moment-timezone": "*",
"underscore": "~1.6.0"
},
"devDependencies": {}
View
5 static/js/account.js
@@ -47,7 +47,10 @@ accountModule.controller('AccountTransactionsCtrl', function ($scope, $http) {
var loadTransactions = function () {
$http.get('/api/v1/accounts/' + $scope.id + '/transactions').success(function(data) {
- $scope.transactions = data;
+ $scope.transactions = _.map(data, function(transaction) {
+ transaction.posted_at = moment(transaction.posted_at).tz('Asia/Shanghai').format();
+ return transaction;
+ });
});
};
View
2  templates/accounts/transactions.html
@@ -48,7 +48,7 @@
<tbody>
<tr ng-repeat="transaction in transactions" class="transaction-{index}">
- <td><a class="nami-tooltip" href="javascript:;" data-toggle="tooltip" title="ID: {{ transaction.id }}, 时间: {{ transaction.posted_at | date: 'yyyy/MM/dd HH:mm' }}, tid: {{ transaction.timeline_id }}">{{ transaction.posted_at }}</a></td>
+ <td><a class="nami-tooltip" href="javascript:;" data-toggle="tooltip" title="ID: {{ transaction.id }}, 时间: {{ transaction.posted_at | date: 'yyyy-MM-dd HH:mm' }}, tid: {{ transaction.timeline_id }}">{{ transaction.posted_at | date: 'yyyy-MM-dd' }}</a></td>
<td>{{ transaction.source_account.name }}</td>
<td>{{ transaction.target_account.name }}</td>
<td>{{ transaction.desc }}</td>
View
3  templates/ng_base.html
@@ -27,7 +27,8 @@
<script src="{% static 'bower_components/jquery/dist/jquery.min.js' %}"></script>
<script src="{% static 'bower_components/select2/select2.js' %}"></script>
<script src="{% static 'bower_components/momentjs/min/moment.min.js' %}"></script>
- <script src="{% static 'bower_components/underscore/underscore.js' %}"></script>
+ <script src="{% static 'bower_components/moment-timezone/moment-timezone.js' %}"></script>
+ <script src="{% static 'bower_components/underscore/underscore.js' %}"></script>
<script src="{% static 'bower_components/angular/angular.js' %}"></script>
<script src="{% static 'bower_components/angular-ui-select2/src/select2.js' %}"></script>
<script src="{% static 'bower_components/angular-animate/angular-animate.js' %}"></script>
Please sign in to comment.
Something went wrong with that request. Please try again.