mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
More catching of empty dates
This commit is contained in:
@@ -38,7 +38,7 @@ class Dayswithqso_model extends CI_Model
|
||||
$dateprev = date_create(date('Y-m-d'));
|
||||
|
||||
foreach($dates as $date) { // Loop through the result set
|
||||
$datecurr = date_create($date->date);
|
||||
$datecurr = date_create($date->date?? '1970-01-01 00:00:00');
|
||||
$diff = $dateprev->diff($datecurr)->format("%a"); // Getting date difference between current date and previous date in array
|
||||
|
||||
if ($diff == 0) {
|
||||
@@ -53,7 +53,7 @@ class Dayswithqso_model extends CI_Model
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
$dateprev = date_create($date->date);
|
||||
$dateprev = date_create($date->date ?? '1970-01-01 00:00:00');
|
||||
}
|
||||
|
||||
if (isset($streaks) && is_array($streaks)) {
|
||||
@@ -78,7 +78,7 @@ class Dayswithqso_model extends CI_Model
|
||||
$dateprev = date_create(date('Y-m-d'));
|
||||
|
||||
foreach($dates as $date) { // Loop through the result set
|
||||
$datecurr = date_create($date->date);
|
||||
$datecurr = date_create($date->date ?? '1970-01-01 00:00:00');
|
||||
$diff = $dateprev->diff($datecurr)->format("%a"); // Getting date difference between current date and previous date in array
|
||||
|
||||
if ($diff == 1 && $firstrun == true) {
|
||||
@@ -116,7 +116,7 @@ class Dayswithqso_model extends CI_Model
|
||||
|
||||
if ($dates) {
|
||||
foreach($dates as $date) { // Loop through the result set
|
||||
$datecurr = date_create($date->date);
|
||||
$datecurr = date_create($date->date ?? '1970-01-01 00:00:00');
|
||||
if ($dateprev == date_create('1900-01-01')) { // If first run
|
||||
$dateprev = $datecurr;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ function write_dxcc_timeline($timeline_array, $custom_date_format, $bandselect,
|
||||
<tbody>';
|
||||
|
||||
foreach ($timeline_array as $line) {
|
||||
$date_as_timestamp = strtotime($line->date);
|
||||
$date_as_timestamp = strtotime($line->date ?? '1970-01-01 00:00:00');
|
||||
echo '<tr>
|
||||
<td>' . $i-- . '</td>
|
||||
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
|
||||
|
||||
Reference in New Issue
Block a user