Skip to content
This repository was archived by the owner on Mar 30, 2024. It is now read-only.

Commit c2fb33d

Browse files
committed
Fix #11
1 parent 10b3cc1 commit c2fb33d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/StatsData.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ class StatsData {
66
const DATE_PREG = '/^\d{4}-(0|1)\d-[0-3]\d$/';
77

88
private int $until = 0;
9+
private int $untilDay = 0;
910
private int $forward = -1;
1011
private array $filelist = array();
1112
private array $dataset = array();
1213

1314
public function __construct(int $time = 0, int $forwardTo = self::FORWARD_TO_NOW) {
1415
$this->forward = ( $forwardTo === self::FORWARD_TO_NOW ) ? time() : $forwardTo;
1516
$this->until = $time;
17+
$this->untilDay = strtotime(date('Y-m-d', $this->until)); // timestamp 00:00 for day of $until
1618
$this->selectUntil();
1719
}
1820

@@ -23,7 +25,7 @@ private function selectUntil() : void {
2325
foreach( $datafiles as $f ){
2426
$timestamp = strtotime(substr($f, 0, -5));
2527
if( $timestamp !== false ){
26-
if( $timestamp >= $this->until && $timestamp <= $this->forward){
28+
if( $timestamp >= $this->untilDay && $timestamp <= $this->forward){
2729
$this->filelist[] = substr($f, 0, -5);
2830
}
2931
}

core/Utilities.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
class Utilities {
66

7-
const VERSION = 'v0.9.1 beta';
7+
const VERSION = 'v0.9.2 beta';
88

99
/**
1010
* OS Consts

0 commit comments

Comments
 (0)