select whereDate to where
This commit is contained in:
1 parent
79271f22e1
commit
d58d543583
15 files changed
+61
-61
No files matched your search
@@ -348,18 +348,18 @@ class EventsTable
|
||||
$end = Carbon::createFromDate($starttime_period['end']);
|
||||
|
||||
return $query
|
||||
->whereDate('starttime', '>=', $from)
|
||||
->whereDate('starttime', '<=', $end);
|
||||
->where('starttime', '>=', $from)
|
||||
->where('starttime', '<=', $end);
|
||||
} elseif (isset($starttime_period['start'])) {
|
||||
$from = Carbon::createFromDate($starttime_period['start']);
|
||||
|
||||
return $query
|
||||
->whereDate('starttime', '>=', $from);
|
||||
->where('starttime', '>=', $from);
|
||||
} elseif (isset($starttime_period['end'])) {
|
||||
$end = Carbon::createFromDate($starttime_period['end']);
|
||||
|
||||
return $query
|
||||
->whereDate('starttime', '<=', $end);
|
||||
->where('starttime', '<=', $end);
|
||||
}
|
||||
}
|
||||
)->when(
|
||||
@@ -530,10 +530,10 @@ class EventsTable
|
||||
$span = $data['starttime_period'];
|
||||
$text = '';
|
||||
if ($span['start'] ?? null) {
|
||||
$text .= 'From '.Carbon::parse($span['start'])->toFormattedDateString();
|
||||
$text .= Carbon::parse($span['start'])->format('d. M.');
|
||||
}
|
||||
if ($span['end'] ?? null) {
|
||||
$text .= ' To '.Carbon::parse($span['end'])->toFormattedDateString();
|
||||
$text .= ' - '.Carbon::parse($span['end'])->format('d. M.');
|
||||
}
|
||||
if ($text) {
|
||||
$indicators[] = Indicator::make($text)->removeField('starttime_period.start')->color('warning');
|
||||
|
||||
Reference in new issue
Block a user