summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/todo/todo.html14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/todo/todo.html b/modules/todo/todo.html
index 309fb18..b196682 100644
--- a/modules/todo/todo.html
+++ b/modules/todo/todo.html
@@ -41,13 +41,20 @@ function pad(s,n,c){
}
function beginOfDay(date){
- return new Date(date.getTime()-date.getHours()*3600*1000-date.getMinutes()*60*1000-date.getSeconds()*1000-date.getMilliseconds());
+ var d=new Date(date.getTime());
+ d.setHours(0);
+ d.setMinutes(0);
+ d.setSeconds(0);
+ d.setMilliseconds(0);
+ return d;
}
function fancytime(timeS){
return pad(timeS.hour,2,"0")+":"+pad(timeS.min,2,"0")+(timeS.sec==0?"":":"+pad(timeS.sec,2,"0"));
}
+var weekdays=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];
+
function fancydate(date){
var now=new Date();
var nowS=datesplit(new Date());
@@ -62,12 +69,12 @@ function fancydate(date){
}
var diffweeks=~~(diffdays/7);
if(diffweeks>0){
- return "In "+diffweeks+" week"+(diffweeks==1?"":"s")+", "+diffdays%7+" day"+(diffdays%7==1?"":"s");
+ return weekdays[(date.getDay()+6)%7]+" in "+diffweeks+" week"+(diffweeks==1?"":"s");
}
if(diffdays==1){
return "Tomorrow, "+fancytime(dateS);
}
- return "In "+diffdays+" day"+(diffdays==1?"":"s")+", "+fancytime(dateS);
+ return weekdays[(date.getDay()+6)%7]+", "+fancytime(dateS);
}
function tablerowfor(task){
@@ -210,7 +217,6 @@ body{
font-size:12px;
font-style:italic;
display:inline-block;
- cursor:help;
}
.subdate{
color:#ccc;