org graphs and relevant test fixed
This commit is contained in:
parent
9594f9f746
commit
12bd6b3ec9
2 changed files with 4 additions and 4 deletions
|
@ -127,10 +127,10 @@ sub _sales_last_duration {
|
||||||
|
|
||||||
my ( $start, $end ) = $c->_get_start_end_duration( $duration );
|
my ( $start, $end ) = $c->_get_start_end_duration( $duration );
|
||||||
|
|
||||||
$data->{bounds} = (
|
$data->{bounds} = {
|
||||||
min => $c->format_iso_datetime( $start ),
|
min => $c->format_iso_datetime( $start ),
|
||||||
max => $c->format_iso_datetime( $end ),
|
max => $c->format_iso_datetime( $end ),
|
||||||
);
|
};
|
||||||
|
|
||||||
while ( $start < $end ) {
|
while ( $start < $end ) {
|
||||||
my $next_end = $start->clone->add( days => 1 );
|
my $next_end = $start->clone->add( days => 1 );
|
||||||
|
|
|
@ -64,7 +64,7 @@ $t->post_ok('/api/v1/organisation/graphs' => json => {
|
||||||
$start->clone->subtract( days => $_ )->subtract( hours => 12 )
|
$start->clone->subtract( days => $_ )->subtract( hours => 12 )
|
||||||
) } reverse ( 0 .. 29 ) ],
|
) } reverse ( 0 .. 29 ) ],
|
||||||
bounds => {
|
bounds => {
|
||||||
min => $t->app->format_iso_datetime($start->clone->subtract( days => 6 )->subtract( hours => 12 ) ),
|
min => $t->app->format_iso_datetime($start->clone->subtract( days => 29 )->subtract( hours => 12 ) ),
|
||||||
max => $t->app->format_iso_datetime($start->clone->add( hours => 12 )),
|
max => $t->app->format_iso_datetime($start->clone->add( hours => 12 )),
|
||||||
},
|
},
|
||||||
data => [ 4, 2, 3, 3, 4, 1, 4, 3, 3, 2, 4, 2, 4, 2, 3, 3, 4, 1, 4, 3, 3, 2, 4, 2, 4, 2, 3, 3, 4, 1 ],
|
data => [ 4, 2, 3, 3, 4, 1, 4, 3, 3, 2, 4, 2, 4, 2, 3, 3, 4, 1, 4, 3, 3, 2, 4, 2, 4, 2, 3, 3, 4, 1 ],
|
||||||
|
@ -96,7 +96,7 @@ $t->post_ok('/api/v1/organisation/graphs' => json => {
|
||||||
$start->clone->subtract( days => $_ )->subtract( hours => 12 )
|
$start->clone->subtract( days => $_ )->subtract( hours => 12 )
|
||||||
) } reverse ( 0 .. 29 ) ],
|
) } reverse ( 0 .. 29 ) ],
|
||||||
bounds => {
|
bounds => {
|
||||||
min => $t->app->format_iso_datetime($start->clone->subtract( days => 6 )->subtract( hours => 12 ) ),
|
min => $t->app->format_iso_datetime($start->clone->subtract( days => 29 )->subtract( hours => 12 ) ),
|
||||||
max => $t->app->format_iso_datetime($start->clone->add( hours => 12 )),
|
max => $t->app->format_iso_datetime($start->clone->add( hours => 12 )),
|
||||||
},
|
},
|
||||||
data => [ 40, 20, 30, 30, 40, 10, 40, 30, 30, 20, 40, 20, 40, 20, 30, 30, 40, 10, 40, 30, 30, 20, 40, 20, 40, 20, 30, 30, 40, 10 ],
|
data => [ 40, 20, 30, 30, 40, 10, 40, 30, 30, 20, 40, 20, 40, 20, 30, 30, 40, 10, 40, 30, 30, 20, 40, 20, 40, 20, 30, 30, 40, 10 ],
|
||||||
|
|
Reference in a new issue