Fix dates
This commit is contained in:
parent
9f4de0dee6
commit
afd273081b
3 changed files with 6 additions and 6 deletions
|
@ -84,9 +84,9 @@ class ApiController extends Controller
|
|||
// Then we get all history for the past month
|
||||
$history = $task
|
||||
->history()
|
||||
->orderBy('created_at', 'asc')
|
||||
->orderBy('created_at', 'desc')
|
||||
->where('created_at', '>', $last_days->toDateString())
|
||||
->selectRaw('date(created_at) as date, status')
|
||||
->selectRaw('date(created_at) as date, created_at, status')
|
||||
->get()
|
||||
;
|
||||
|
||||
|
@ -126,7 +126,7 @@ class ApiController extends Controller
|
|||
|
||||
foreach ($history as $k => $h) {
|
||||
// We only take tasks when status has changed between them
|
||||
if ($h->status == $prev) {
|
||||
if (! is_null($prev) && $h->status == $prev) {
|
||||
unset($history[$k]);
|
||||
}
|
||||
$prev = $h->status;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -40,7 +40,7 @@
|
|||
<tbody>
|
||||
<tr
|
||||
v-for="h in history"
|
||||
v-bind:key="history.id"
|
||||
v-bind:key="h.id"
|
||||
>
|
||||
<td>{{ moment(h.created_at).format('YYYY-MM-DD') }}</td>
|
||||
<td>{{ moment(h.created_at).format('HH:mm:ss') }}</td>
|
||||
|
|
Loading…
Add table
Reference in a new issue