Delete Fork\utc() function
This commit is contained in:
parent
72c250be11
commit
26a81bef62
4 changed files with 4 additions and 42 deletions
|
@ -6,8 +6,6 @@ use ForkBB\Core\Container;
|
|||
|
||||
/**
|
||||
* Инициализирует другие функции (передача контейнера)
|
||||
*
|
||||
* @param Container $c
|
||||
*/
|
||||
function _init(Container $c): void
|
||||
{
|
||||
|
@ -18,10 +16,7 @@ function _init(Container $c): void
|
|||
/**
|
||||
* Транслирует строку с подстановкой аргументов
|
||||
*
|
||||
* @param string $arg
|
||||
* @param mixed ...$args
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function __(?string $arg, ...$args): string
|
||||
{
|
||||
|
@ -62,10 +57,6 @@ function __(?string $arg, ...$args): string
|
|||
|
||||
/**
|
||||
* Экранирует спецсимволов HTML-сущностями
|
||||
*
|
||||
* @param string $arg
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function e(string $arg): string
|
||||
{
|
||||
|
@ -76,9 +67,6 @@ function e(string $arg): string
|
|||
* Возвращает число в формате текущего пользователя
|
||||
*
|
||||
* @param mixed $number
|
||||
* @param int $decimals
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function num($number, int $decimals = 0): string
|
||||
{
|
||||
|
@ -89,16 +77,6 @@ function num($number, int $decimals = 0): string
|
|||
|
||||
/**
|
||||
* Возвращает дату/время в формате текущего пользователя
|
||||
*
|
||||
* @param int $arg
|
||||
* @param bool $dateOnly
|
||||
* @param string $dateFormat
|
||||
* @param string $timeFormat
|
||||
* @param bool $timeOnly
|
||||
* @param bool $noText
|
||||
* @param Container $container
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function dt(int $arg, bool $dateOnly = false, string $dateFormat = null, string $timeFormat = null, bool $timeOnly = false, bool $noText = false, Container $container = null): string
|
||||
{
|
||||
|
@ -144,24 +122,8 @@ function dt(int $arg, bool $dateOnly = false, string $dateFormat = null, string
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Преобразует timestamp в YYYY-MM-DDTHH:mm:ss.sssZ
|
||||
*
|
||||
* @param int $timestamp
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function utc(int $timestamp): string
|
||||
{
|
||||
return \gmdate('c', $timestamp); // Y-m-d\TH:i:s\Z
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает размер в байтах, Кбайтах, ...
|
||||
*
|
||||
* @param int $size
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function size(int $size): string
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
@if ($post->id)
|
||||
<article id="p{!! $post->id !!}" class="f-post">
|
||||
<header class="f-post-header">
|
||||
<span class="f-post-posted"><time datetime="{{ utc($post->posted) }}">{{ dt($post->posted) }}</time></span>
|
||||
<span class="f-post-posted"><time datetime="{{ \gmdate('c', $post->posted) }}">{{ dt($post->posted) }}</time></span>
|
||||
<span class="f-post-number"><a href="{!! $post->link !!}" rel="bookmark">#{!! $post->postNumber !!}</a></span>
|
||||
</header>
|
||||
<address class="f-post-user">
|
||||
|
|
|
@ -52,9 +52,9 @@
|
|||
<header class="f-post-header">
|
||||
<h3>@if ($post->postNumber > 1) {!! __('Re') !!} @endif {{ $p->model->censorSubject }}</h3>
|
||||
@if ($p->enableMod && $post->postNumber > 1)
|
||||
<label class="f-post-posted" for="checkbox-{!! $post->id !!}" title="{{ __('Select for moderation') }}"><time datetime="{{ utc($post->posted) }}">{{ dt($post->posted) }}</time></label>
|
||||
<label class="f-post-posted" for="checkbox-{!! $post->id !!}" title="{{ __('Select for moderation') }}"><time datetime="{{ \gmdate('c', $post->posted) }}">{{ dt($post->posted) }}</time></label>
|
||||
@else
|
||||
<span class="f-post-posted"><time datetime="{{ utc($post->posted) }}">{{ dt($post->posted) }}</time></span>
|
||||
<span class="f-post-posted"><time datetime="{{ \gmdate('c', $post->posted) }}">{{ dt($post->posted) }}</time></span>
|
||||
@endif
|
||||
@if ($post->edited)
|
||||
<span class="f-post-edited" title="{!! __('Last edit', $post->edited_by, dt($post->edited)) !!}">{!! __('Edited') !!}</span>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<h3>
|
||||
<span class="f-psh-forum"><a href="{!! $post->parent->parent->link !!}" title="{!! __('Go to forum') !!}">{{ $post->parent->parent->forum_name }}</a></span>
|
||||
<span class="f-psh-topic"><a href="{!! $post->parent->link !!}" title="{!! __('Go to topic') !!}">@if ($post->id !== $post->parent->first_post_id) {!! __('Re') !!} @endif {{ $post->parent->censorSubject }}</a></span>
|
||||
<span class="f-post-posted"><a href="{!! $post->link !!}" title="{!! __('Go to post') !!}" rel="bookmark"><time datetime="{{ utc($post->posted) }}">{{ dt($post->posted) }}</time></a></span>
|
||||
<span class="f-post-posted"><a href="{!! $post->link !!}" title="{!! __('Go to post') !!}" rel="bookmark"><time datetime="{{ \gmdate('c', $post->posted) }}">{{ dt($post->posted) }}</time></a></span>
|
||||
</h3>
|
||||
<span class="f-post-number">#{!! $post->postNumber !!}</span>
|
||||
</header>
|
||||
|
|
Loading…
Add table
Reference in a new issue