Permalink
Browse files

change the way to show tweet created date

  • Loading branch information...
1 parent 41bd189 commit b8d5c605a45d96be0fc8910a038458dde996e5ce @keiko713 committed Apr 3, 2012
Showing with 6 additions and 13 deletions.
  1. +5 −11 templates/index.html
  2. +1 −2 tweets/views.py
View
@@ -128,24 +128,18 @@
});
function adjusttime() {
- var tmpdate = new Date();
- var tzoffset = tmpdate.getTimezoneOffset() * 60000;
-
$('.datetime').each(function(idx,obj){
- var date_epoch = $(obj).attr('alt');
- var orgtime = new Date(date_epoch - tzoffset);
- $(obj).html(format(orgtime));
+ var mydate = new Date($(obj).attr('alt'));
+ $(obj).html(format(mydate));
});
}
function format(datetime) {
var y = datetime.getFullYear();
var m = addzero(datetime.getMonth() + 1);
- var d = addzero(datetime.getDate());
- var hour = addzero(datetime.getHours());
- var min = addzero(datetime.getMinutes());
- var sec = addzero(datetime.getSeconds());
- return y + '/' + m + '/' + d + ' ' + hour + ':' + min + ':' + sec
+ var d = addzero(datetime.getDate());
+ var time = datetime.toLocaleTimeString();
+ return y + '/' + m + '/' + d + ' ' + time;
}
function addzero(arg) {
View
@@ -50,8 +50,7 @@ def search_photos(page_id):
text = get_urlize_text(result)
entities_urls = entities['urls']
media = entities.get('media', '')
- date = datetime.strptime(result['created_at'], '%a, %d %b %Y %H:%M:%S +%f')
- date_epoch = int(time.mktime(date.timetuple())) * 1000
+ date_epoch = result['created_at']
from_user = result['from_user']
if is_blacklist_name(from_user):

0 comments on commit b8d5c60

Please sign in to comment.