Make dates a little more user friendly

This commit is contained in:
Dane Everitt 2016-10-28 16:34:23 -04:00
parent 449324fa1c
commit 63d7062f3c
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 21 additions and 3 deletions

View file

@ -51,7 +51,7 @@
<h3 class="panel-title">File Path Information</h3>
</div>
<div class="panel-body">
When configuring any file paths in your server plugins or settings you should use <code>/home/container</code> as your base path. While your SFTP client sees the files as <code>/public</code> this is not true for the server process.
When configuring any file paths in your server plugins or settings you should use <code>/home/container</code> as your base path.
</div>
</div>
</div>

View file

@ -63,7 +63,16 @@
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">{{ $folder['entry'] }}</a>
</td>
<td data-identifier="size">{{ $folder['size'] }}</td>
<td data-identifier="modified">{{ date('m/d/y H:i:s', $folder['date']) }}</td>
<td data-identifier="modified">
<?php $carbon = Carbon::createFromTimestamp($folder['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?>
@if($carbon->diffInMinutes(Carbon::now()) > 60)
{{ $carbon->format('m/d/y H:i:s') }}
@elseif($carbon->diffInSeconds(Carbon::now()) < 5 || $carbon->isFuture())
<em>seconds ago</em>
@else
{{ $carbon->diffForHumans() }}
@endif
</td>
</tr>
@endforeach
@foreach ($files as $file)
@ -130,7 +139,16 @@
@endif
</td>
<td data-identifier="size">{{ $file['size'] }}</td>
<td data-identifier="modified">{{ date('m/d/y H:i:s', $file['date']) }}</td>
<td data-identifier="modified">
<?php $carbon = Carbon::createFromTimestamp($file['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?>
@if($carbon->diffInMinutes(Carbon::now()) > 60)
{{ $carbon->format('m/d/y H:i:s') }}
@elseif($carbon->diffInSeconds(Carbon::now()) < 5 || $carbon->isFuture())
<em>seconds ago</em>
@else
{{ $carbon->diffForHumans() }}
@endif
</td>
</tr>
@endforeach
</tbody>