Fixed datetime when best_before_date is empty

This commit is contained in:
CrypterEmerald 2021-11-15 12:59:59 +01:00
parent 3172f8d413
commit 6f1727f768
2 changed files with 3 additions and 3 deletions

View File

@ -241,7 +241,7 @@
<span id="stock-{{ $stockEntry->id }}-due-date">{{ $stockEntry->best_before_date }}</span> <span id="stock-{{ $stockEntry->id }}-due-date">{{ $stockEntry->best_before_date }}</span>
<time id="stock-{{ $stockEntry->id }}-due-date-timeago" <time id="stock-{{ $stockEntry->id }}-due-date-timeago"
class="timeago timeago-contextual" class="timeago timeago-contextual"
datetime="{{ $stockEntry->best_before_date }} 23:59:59"></time> @if($stockEntry->best_before_date != "") datetime="{{ $stockEntry->best_before_date }} 23:59:59" @endif></time>
</td> </td>
<td id="stock-{{ $stockEntry->id }}-location" <td id="stock-{{ $stockEntry->id }}-location"
class="@if(!GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif" class="@if(!GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif"
@ -265,7 +265,7 @@
<span id="stock-{{ $stockEntry->id }}-purchased-date">{{ $stockEntry->purchased_date }}</span> <span id="stock-{{ $stockEntry->id }}-purchased-date">{{ $stockEntry->purchased_date }}</span>
<time id="stock-{{ $stockEntry->id }}-purchased-date-timeago" <time id="stock-{{ $stockEntry->id }}-purchased-date-timeago"
class="timeago timeago-contextual" class="timeago timeago-contextual"
datetime="{{ $stockEntry->purchased_date }} 23:59:59"></time> @if($stockEntry->purchased_date != "") datetime="{{ $stockEntry->purchased_date }} 23:59:59" @endif></time>
</td> </td>
<td class="d-none">{{ $stockEntry->purchased_date }}</td> <td class="d-none">{{ $stockEntry->purchased_date }}</td>
<td> <td>

View File

@ -352,7 +352,7 @@
<span id="product-{{ $currentStockEntry->product_id }}-next-due-date">{{ $currentStockEntry->best_before_date }}</span> <span id="product-{{ $currentStockEntry->product_id }}-next-due-date">{{ $currentStockEntry->best_before_date }}</span>
<time id="product-{{ $currentStockEntry->product_id }}-next-due-date-timeago" <time id="product-{{ $currentStockEntry->product_id }}-next-due-date-timeago"
class="timeago timeago-contextual" class="timeago timeago-contextual"
datetime="{{ $currentStockEntry->best_before_date }} 23:59:59"></time> @if($currentStockEntry->best_before_date != "") datetime="{{ $currentStockEntry->best_before_date }} 23:59:59" @endif></time>
</td> </td>
<td class="d-none"> <td class="d-none">
@foreach(FindAllObjectsInArrayByPropertyValue($currentStockLocations, 'product_id', $currentStockEntry->product_id) as $locationsForProduct) @foreach(FindAllObjectsInArrayByPropertyValue($currentStockLocations, 'product_id', $currentStockEntry->product_id) as $locationsForProduct)