diff --git a/src/db/concern/TimeFieldQuery.php b/src/db/concern/TimeFieldQuery.php index 69b7eae4b7267230cb371def9b60d36bd24c8f1c..d71079ca23ac75f55792cb9673348e1fabd7da66 100644 --- a/src/db/concern/TimeFieldQuery.php +++ b/src/db/concern/TimeFieldQuery.php @@ -97,7 +97,7 @@ trait TimeFieldQuery public function whereMonth(string $field, string $month = 'this month', int $step = 1, string $logic = 'AND') { if (in_array($month, ['this month', 'last month'])) { - $month = date('Y-m', strtotime($month)); + $month = date('Y-m', strtotime('first day of ' . $month)); } return $this->whereTimeInterval($field, $month, 'month', $step, $logic);