Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
ordering fix; timestamp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ichuan committed Feb 16, 2012
1 parent 1503154 commit 25deeea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions static/js/jihua.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@
} else
return ['刚刚', '刚刚'];
} else if (days >= 0 && days < 7) {
var hm = pad0(d2.getHours(), 2) + ':' + pad0(d2.getMinutes(), 2);
if (days == 0)
return '昨天 ' + pad0(d2.getHours(), 2) + ':' + pad0(d2.getMinutes(), 2);
return ['昨天 ' + hm, '昨天 ' + hm]
else if (days == 1)
return '前天 ' + pad0(d2.getHours(), 2) + ':' + pad0(d2.getMinutes(), 2);
return ['前天 ' + hm, '前天 ' + hm]
else {
var num = days + 1;
return ['' + num + ' 天前', '' + num + '天'];
Expand Down Expand Up @@ -118,7 +119,7 @@
model: Activity,
url: API_ROOT + '/activities/',
comparator: function(activity){
return activity.get('id');
return -parseInt(activity.get('id'), 10);
}
});

Expand Down
2 changes: 1 addition & 1 deletion static/js/jihua.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load i18n %}

{% block css %}
<link href="{{ settings.MEDIA_URL }}css/jihua.min.css?20120215" rel="stylesheet">
<link href="{{ settings.MEDIA_URL }}css/jihua.min.css?20120216" rel="stylesheet">
<link href="{{ settings.MEDIA_URL }}css/jquery-ui.min.css" rel="stylesheet">
{% endblock %}

Expand Down Expand Up @@ -35,7 +35,7 @@
.script('{{ settings.MEDIA_URL }}js/jquery-ui.min.js')
.script('{{ settings.MEDIA_URL }}js/utils.js')
.script('{{ settings.MEDIA_URL }}js/bootstrap-modal.js').wait()
.script('{{ settings.MEDIA_URL }}js/jihua.min.js?20120215').wait(function(){
.script('{{ settings.MEDIA_URL }}js/jihua.min.js?20120216').wait(function(){
window.initTodos = JSON.parse(atob('{{ todos|safe }}'));
window.initActivities = JSON.parse(atob('{{ activities|safe }}'));
$(function(){
Expand Down
2 changes: 1 addition & 1 deletion todo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ def to_dict(self):
}

class Meta:
ordering = ['-id']
ordering = ['-created']
verbose_name_plural = verbose_name = u'计划'

0 comments on commit 25deeea

Please sign in to comment.