forge/resources/views/components/mod-list-stats.blade.php
Refringe 75ebc827dc
Carbon dynamicFormat macro
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
2024-09-09 23:14:30 -04:00

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>
&mdash; Created
<time datetime="{{ $mod->created_at->format('c') }}">
{{ Carbon::dynamicFormat($mod->created_at) }}
</time>
</span>
@elseif(!is_null($modVersion->updated_at))
<span>
&mdash; Updated
<time datetime="{{ $modVersion->updated_at->format('c') }}">
{{ Carbon::dynamicFormat($modVersion->updated_at) }}
</time>
</span>
@endif
</p>