Permalink
Browse files

Format date properly

  • Loading branch information...
1 parent 5f4b32f commit 3cc62f783fb39b7a73821410b00a74a014e2de82 @ferblape committed Apr 4, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 index.html
View
@@ -38,9 +38,12 @@
}
function loadInfoWindow(photo){
+ var date = new Date(parseInt(photo.created_time)*1000),
+ formatedDate = date.getFullYear() + '-' + parseInt(date.getMonth()+1) + '-' + date.getDate() +
+ ' ' + date.getUTCHours() + ':' + date.getUTCMinutes() + ':' + date.getUTCSeconds();
$('.item_data img').attr('src', photo.user.profile_picture);
$('.item_data p strong').html(photo.user.username);
- $('.item_data span.date').html(photo.created_time);
+ $('.item_data span.date').html(formatedDate);
$('.item_data a').attr('href', photo.link);
$('.content.instagram').html('<img src="' + photo.images.low_resolution.url + '" />');
$('#content').show();
@@ -68,7 +71,7 @@
<body>
<header id="top_bar">
- <h1>Madrid instagram activity <span></span></h1>
+<h1>Madrid instagr.am activity <span></span></h1>
</header>
<div class="popover" id="content" style="display:none">

0 comments on commit 3cc62f7

Please sign in to comment.