mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #3345: Set Date.now as max for accounting
This commit is contained in:
parent
9ddae9673b
commit
8216b97ff3
@ -5399,10 +5399,16 @@ function fillAccounting(div, req, response, no_table) {
|
||||
var start = new Date(options.start_time * 1000);
|
||||
start.setUTCHours(0,0,0,0);
|
||||
|
||||
var end = new Date();
|
||||
var end;
|
||||
var now = new Date();
|
||||
|
||||
if(options.end_time != undefined && options.end_time != -1){
|
||||
var end = new Date(options.end_time * 1000)
|
||||
if (options.end_time != undefined && options.end_time != -1) {
|
||||
end = new Date(options.end_time * 1000)
|
||||
if (end > now) {
|
||||
end = now;
|
||||
}
|
||||
} else {
|
||||
end = now;
|
||||
}
|
||||
|
||||
// granularity of 1 day
|
||||
@ -5419,6 +5425,10 @@ function fillAccounting(div, req, response, no_table) {
|
||||
tmp_time.setUTCDate( tmp_time.getUTCDate() + 1 );
|
||||
}
|
||||
|
||||
if (tmp_time > now) {
|
||||
times.push(now.getTime());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Flot options
|
||||
//--------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user