From afcae0d9514f35c96484e6db1eb21e76821b5654 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Sun, 12 Nov 2006 22:09:39 +0000 Subject: display human readable picture upload time git-svn-id: http://svn.klever.net/kin/fireflix/trunk@215 fe716a7a-6dde-0310-88d9-d003556173a8 --- diff --git a/content/fireflix.js b/content/fireflix.js index 85b4d39..a4f13b6 100644 --- a/content/fireflix.js +++ b/content/fireflix.js @@ -101,7 +101,13 @@ var fireflix = { var p = this.photos[r]; if(c.id=='sp_title') return p.title; if(c.id=='sp_taken') return p.datetaken; - if(c.id=='sp_upload') return p.dateupload; /* TODO: unixtime conversion */ + if(c.id=='sp_upload') { + var du = new Date(p.dateupload*1000); + var rv = du.getFullYear()+'-'+(du.getMonth()+1)+'-'+du.getDate() + +' '+ + du.getHours()+':'+du.getMinutes()+':'+du.getSeconds(); + return rv.replace(/(\D)(\d)(\D)/,'$10$2$3'); + } return c.id; }, setTree: function(t) { this.tree = t }, -- cgit v0.9.0.2