File: format_date.test

package info (click to toggle)
php-twig 3.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,940 kB
  • sloc: php: 23,320; makefile: 110; sh: 43
file content (28 lines) | stat: -rw-r--r-- 905 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
"format_date" filter
--CONDITION--
version_compare(Symfony\Component\Intl\Intl::getIcuVersion(), '72.1', '<')
--TEMPLATE--
{{ '2019-08-07 23:39:12'|format_datetime() }}
{{ '2019-08-07 23:39:12'|format_datetime(locale='fr') }}
{{ '2019-08-07 23:39:12'|format_datetime('none', 'short', locale='fr') }}
{{ '2019-08-07 23:39:12'|format_datetime('short', 'none', locale='fr') }}
{{ '2019-08-07 23:39:12'|format_datetime('full', 'full', locale='fr') }}
{{ '2019-08-07 23:39:12'|format_datetime(pattern="hh 'oclock' a, zzzz") }}

{{ '2019-08-07 23:39:12'|format_date }}
{{ '2019-08-07 23:39:12'|format_date(locale='fr') }}
{{ '2019-08-07 23:39:12'|format_time }}
--DATA--
return [];
--EXPECT--
Aug 7, 2019, 11:39:12 PM
7 août 2019, 23:39:12
23:39
07/08/2019
mercredi 7 août 2019 à 23:39:12 temps universel coordonné
11 oclock PM, Coordinated Universal Time

Aug 7, 2019
7 août 2019
11:39:12 PM