mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
Adds a dynamicFormat macro/method on the Carbon facade to handle the logic of conditionally formatting the dates based on the difference to the current time. Logic pulled from #48 (Thanks Waffle!) Issue #45
19 lines
721 B
PHP
19 lines
721 B
PHP
<p {{ $attributes->class(['text-slate-700 dark:text-gray-300 text-sm']) }}>
|
|
<span title="{{ __('Exactly') }} {{ $mod->downloads }}">{{ Number::downloads($mod->downloads) }} downloads</span>
|
|
@if(!is_null($mod->created_at))
|
|
<span>
|
|
— Created
|
|
<time datetime="{{ $mod->created_at->format('c') }}">
|
|
{{ Carbon::dynamicFormat($mod->created_at) }}
|
|
</time>
|
|
</span>
|
|
@elseif(!is_null($modVersion->updated_at))
|
|
<span>
|
|
— Updated
|
|
<time datetime="{{ $modVersion->updated_at->format('c') }}">
|
|
{{ Carbon::dynamicFormat($modVersion->updated_at) }}
|
|
</time>
|
|
</span>
|
|
@endif
|
|
</p>
|