Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
prettydate.php
1
<?php
8
namespace
Bitrix\Sender\Internals
;
9
10
use
Bitrix\Main\Localization\Loc
;
11
use
Bitrix\Main\Application
;
12
use
Bitrix\Main\Type\Date
;
13
use
Bitrix\Main\Type\DateTime
;
14
15
Loc::loadMessages
(__FILE__);
16
21
class
PrettyDate
22
{
28
public
static
function
getDateTimeFormat
()
29
{
30
$isAmPm = IsAmPmMode(
true
);
31
switch
($isAmPm)
32
{
33
case
AM_PM_LOWER:
34
return
Loc::getMessage
(
'SENDER_PRETTY_DATE_FORMAT_DATETIME_PM_LOWER'
);
35
36
case
AM_PM_UPPER:
37
return
Loc::getMessage
(
'SENDER_PRETTY_DATE_FORMAT_DATETIME_PM_UPPER'
);
38
}
39
40
return
Loc::getMessage
(
'SENDER_PRETTY_DATE_FORMAT_DATETIME'
);
41
}
42
48
public
static
function
getDateFormat
()
49
{
50
return
Loc::getMessage
(
'SENDER_PRETTY_DATE_FORMAT_DATE'
);
51
}
52
59
public
static
function
formatDateTime
(
DateTime
$date =
null
)
60
{
61
$date = $date ?:
new
DateTime
();
62
return \FormatDate(self::getDateTimeFormat(), MakeTimeStamp($date));
63
}
64
71
public
static
function
formatDate
(
Date
$date =
null
)
72
{
73
$date = $date ?:
new
Date
();
74
return \FormatDate(self::getDateFormat(),
DateTime::createFromTimestamp
(MakeTimeStamp($date)));
75
}
76
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\Type\Date
Definition
date.php:9
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Main\Type\DateTime\createFromTimestamp
static createFromTimestamp($timestamp)
Definition
datetime.php:246
Bitrix\Sender\Internals\PrettyDate
Definition
prettydate.php:22
Bitrix\Sender\Internals\PrettyDate\getDateTimeFormat
static getDateTimeFormat()
Definition
prettydate.php:28
Bitrix\Sender\Internals\PrettyDate\formatDate
static formatDate(Date $date=null)
Definition
prettydate.php:71
Bitrix\Sender\Internals\PrettyDate\formatDateTime
static formatDateTime(DateTime $date=null)
Definition
prettydate.php:59
Bitrix\Sender\Internals\PrettyDate\getDateFormat
static getDateFormat()
Definition
prettydate.php:48
Bitrix\Sender\Internals
modules
sender
lib
internals
prettydate.php
Создано системой
1.10.0