mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-01-31 14:36:15 +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){
|
function generate_offset_to_time(num){
|
||||||
var to_ret = {};
|
var to_ret = {};
|
||||||
for(i=0; i<=num; i++)
|
for(i=0; i<=num; i++) {
|
||||||
to_ret[i] = new Date().getHours()-(23-i)+'h';
|
var t1 = new Date().getHours()-(23-i);
|
||||||
|
t1 = t1 < 0 ? 24+t1 : t1;
|
||||||
|
to_ret[i] = t1+'h';
|
||||||
|
}
|
||||||
return to_ret;
|
return to_ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,7 +16,9 @@
|
||||||
for(i=day; i>=0; i--){
|
for(i=day; i>=0; i--){
|
||||||
for(j=0; j<24; j++){
|
for(j=0; j<24; j++){
|
||||||
var t1 =now.getDate()-i + ":";
|
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;
|
to_ret[j+24*(day-i)] = t1+t2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue