mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 00:28:22 +00:00
Replaced negative hour by 24h based.
This commit is contained in:
parent
85ab0e36ff
commit
6be557890c
1 changed files with 8 additions and 3 deletions
|
@ -1,8 +1,11 @@
|
|||
|
||||
function generate_offset_to_time(num){
|
||||
var to_ret = {};
|
||||
for(i=0; i<=num; i++)
|
||||
to_ret[i] = new Date().getHours()-(23-i)+'h';
|
||||
for(i=0; i<=num; i++) {
|
||||
var t1 = new Date().getHours()-(23-i);
|
||||
t1 = t1 < 0 ? 24+t1 : t1;
|
||||
to_ret[i] = t1+'h';
|
||||
}
|
||||
return to_ret;
|
||||
};
|
||||
|
||||
|
@ -13,7 +16,9 @@
|
|||
for(i=day; i>=0; i--){
|
||||
for(j=0; j<24; j++){
|
||||
var t1 =now.getDate()-i + ":";
|
||||
var t2 =now.getHours()-(23-j)+"h";
|
||||
var t2 =now.getHours()-(23-j);
|
||||
t2 = t2 < 0 ? 24+t2 : t2;
|
||||
t2 += "h";
|
||||
to_ret[j+24*(day-i)] = t1+t2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue