我有以下循环,其中我从查询中提取值并用表编写表,在该字段中,我需要根据从发货日期到今天为止所经过的天数,更改年龄的字段
我已经在CSS中尝试过了[data-age> 180],但是我只遇到错误,而且找不到与我的需求类似的情况,另外,id喜欢在循环内进行操作,而不是另外的代码,因为它弄乱了我的视线
@foreach($shipments as $shipment)
{{$shipment->id}}{{$shipment->tracking}}{{$shipment->PartNumber}}{{$shipment->DateShipped}}data-title="age"
data-age="{{
(int) floor(
(time() - strtotime($shipment->DateShipped))
/ (60 * 60 * 24)
)
}}"
>{{
(int) floor(
(time() - strtotime($shipment->DateShipped)) / (60 * 60 * 24)
)
}} days
{{$shipment->Qtyorder}}{{$shipment->QtyShipped}}{{$shipment->QtyBckorder}}{{$shipment->purchaseOrder}}{{$shipment->OrderNumber}}{{$shipment->paperwork}}{{$shipment->VMIreceived}}{{$shipment->VMIticketNumber}}{{$shipment->VMILRB}}href="{{ route('shipment.edit',$shipment->id)}}"
class="btn btn-primary"
>
Edit
@csrf
@method('DELETE')
Delete
@endforeach