Add translation of modified_at time, using php-intl

This commit is contained in:
Stéphane Goetz 2018-09-21 22:11:49 +02:00
parent 3982139892
commit d93ad8c6b1
9 changed files with 333 additions and 123 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
vendor
node_modules

View File

@ -1,11 +1,16 @@
FROM composer:1.7.2 AS composer
FROM php:7-alpine
RUN apk info && apk add --no-cache unzip
RUN apk info && apk add --no-cache unzip icu-dev
RUN docker-php-ext-configure intl \
&& docker-php-ext-install intl
RUN mkdir /daux && mkdir /build
WORKDIR /daux
COPY --from=composer /usr/bin/composer /usr/bin/composer
# Copy files
COPY bin/ /daux/bin/
@ -18,13 +23,7 @@ COPY composer.json /daux/composer.json
COPY composer.lock /daux/composer.lock
COPY index.php /daux/index.php
# Composer install
RUN cd /daux && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php \
&& rm composer-setup.php \
&& php composer.phar install --prefer-dist --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader \
&& rm composer.phar
RUN composer install --prefer-dist --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader
RUN ln -s /daux/bin/daux /usr/local/bin/daux

View File

@ -26,7 +26,11 @@
"symfony/http-foundation": "^4.0",
"symfony/process": "^4.0",
"webuni/commonmark-table-extension": "0.6.*",
"webuni/front-matter": "^1.0.0"
"webuni/front-matter": "^1.0.0",
"symfony/polyfill-intl-icu": "^1.9"
},
"suggest":{
"ext-intl": "Allows to translate the modified at date"
},
"autoload": {
"psr-4": {

395
composer.lock generated
View File

@ -4,20 +4,21 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "ee84fe336a7944fe271c01b5336bc7f0",
"hash": "558d6a5fa50eb7e88d8380a2a83db5e2",
"content-hash": "63a2af7d7b04bfbee7171ca185d00a5b",
"packages": [
{
"name": "guzzlehttp/guzzle",
"version": "6.3.0",
"version": "6.3.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699"
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
"reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
},
"require": {
@ -27,7 +28,7 @@
},
"require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "^4.0 || ^5.0",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"psr/log": "^1.0"
},
"suggest": {
@ -36,7 +37,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.2-dev"
"dev-master": "6.3-dev"
}
},
"autoload": {
@ -69,7 +70,7 @@
"rest",
"web service"
],
"time": "2017-06-22T18:50:49+00:00"
"time": "2018-04-22 15:46:56"
},
{
"name": "guzzlehttp/promises",
@ -120,7 +121,7 @@
"keywords": [
"promise"
],
"time": "2016-12-20T10:07:11+00:00"
"time": "2016-12-20 10:07:11"
},
{
"name": "guzzlehttp/psr7",
@ -185,7 +186,7 @@
"uri",
"url"
],
"time": "2017-03-20T17:10:46+00:00"
"time": "2017-03-20 17:10:46"
},
{
"name": "league/commonmark",
@ -254,7 +255,7 @@
"markdown",
"parser"
],
"time": "2017-10-26T15:41:07+00:00"
"time": "2017-10-26 15:41:07"
},
{
"name": "league/plates",
@ -309,29 +310,32 @@
"templating",
"views"
],
"time": "2016-12-28T00:14:17+00:00"
"time": "2016-12-28 00:14:17"
},
{
"name": "myclabs/deep-copy",
"version": "1.7.0",
"version": "1.8.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e"
"reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
"reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8",
"reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0"
"php": "^7.1"
},
"replace": {
"myclabs/deep-copy": "self.version"
},
"require-dev": {
"doctrine/collections": "^1.0",
"doctrine/common": "^2.6",
"phpunit/phpunit": "^4.1"
"phpunit/phpunit": "^7.1"
},
"type": "library",
"autoload": {
@ -354,7 +358,7 @@
"object",
"object graph"
],
"time": "2017-10-19T19:58:43+00:00"
"time": "2018-06-11 23:09:50"
},
{
"name": "psr/http-message",
@ -404,20 +408,20 @@
"request",
"response"
],
"time": "2016-08-06T14:39:51+00:00"
"time": "2016-08-06 14:39:51"
},
{
"name": "symfony/console",
"version": "v4.0.5",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51"
"reference": "ca80b8ced97cf07390078b29773dc384c39eee1f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/555c8dbe0ae9e561740451eabdbed2cc554b6a51",
"reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51",
"url": "https://api.github.com/repos/symfony/console/zipball/ca80b8ced97cf07390078b29773dc384c39eee1f",
"reference": "ca80b8ced97cf07390078b29773dc384c39eee1f",
"shasum": ""
},
"require": {
@ -437,7 +441,7 @@
"symfony/process": "~3.4|~4.0"
},
"suggest": {
"psr/log": "For using the console logger",
"psr/log-implementation": "For using the console logger",
"symfony/event-dispatcher": "",
"symfony/lock": "",
"symfony/process": ""
@ -445,7 +449,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
"dev-master": "4.1-dev"
}
},
"autoload": {
@ -472,20 +476,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2018-02-26T15:55:47+00:00"
"time": "2018-07-26 11:24:31"
},
{
"name": "symfony/http-foundation",
"version": "v4.0.5",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "94139989e51193e62a46bc87741ae05c8e8390f5"
"reference": "3a5c91e133b220bb882b3cd773ba91bf39989345"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/94139989e51193e62a46bc87741ae05c8e8390f5",
"reference": "94139989e51193e62a46bc87741ae05c8e8390f5",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/3a5c91e133b220bb882b3cd773ba91bf39989345",
"reference": "3a5c91e133b220bb882b3cd773ba91bf39989345",
"shasum": ""
},
"require": {
@ -493,12 +497,13 @@
"symfony/polyfill-mbstring": "~1.1"
},
"require-dev": {
"predis/predis": "~1.0",
"symfony/expression-language": "~3.4|~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
"dev-master": "4.1-dev"
}
},
"autoload": {
@ -525,20 +530,211 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2018-02-22T10:50:29+00:00"
"time": "2018-08-27 17:47:02"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.7.0",
"name": "symfony/intl",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b"
"url": "https://github.com/symfony/intl.git",
"reference": "ab0fba135f163ca6e1d72ab6fdeac49e0285e6b0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b",
"reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b",
"url": "https://api.github.com/repos/symfony/intl/zipball/ab0fba135f163ca6e1d72ab6fdeac49e0285e6b0",
"reference": "ab0fba135f163ca6e1d72ab6fdeac49e0285e6b0",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-intl-icu": "~1.0"
},
"require-dev": {
"symfony/filesystem": "~3.4|~4.0"
},
"suggest": {
"ext-intl": "to use the component with locales other than \"en\""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Intl\\": ""
},
"classmap": [
"Resources/stubs"
],
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
},
{
"name": "Eriksen Costa",
"email": "eriksen.costa@infranology.com.br"
},
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "A PHP replacement layer for the C intl extension that includes additional data from the ICU library.",
"homepage": "https://symfony.com",
"keywords": [
"i18n",
"icu",
"internationalization",
"intl",
"l10n",
"localization"
],
"time": "2018-08-01 08:24:03"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
},
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"time": "2018-08-06 14:22:27"
},
{
"name": "symfony/polyfill-intl-icu",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-icu.git",
"reference": "f22a90256d577c7ef7efad8df1f0201663d57644"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/f22a90256d577c7ef7efad8df1f0201663d57644",
"reference": "f22a90256d577c7ef7efad8df1f0201663d57644",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/intl": "~2.3|~3.0|~4.0"
},
"suggest": {
"ext-intl": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for intl's ICU-related data and classes",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"icu",
"intl",
"polyfill",
"portable",
"shim"
],
"time": "2018-08-06 14:22:27"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8",
"shasum": ""
},
"require": {
@ -550,7 +746,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.7-dev"
"dev-master": "1.9-dev"
}
},
"autoload": {
@ -584,20 +780,20 @@
"portable",
"shim"
],
"time": "2018-01-30T19:27:44+00:00"
"time": "2018-08-06 14:22:27"
},
{
"name": "symfony/process",
"version": "v4.0.5",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "6ed08502a7c9559da8e60ea343bdbd19c3350b3e"
"reference": "86cdb930a6a855b0ab35fb60c1504cb36184f843"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/6ed08502a7c9559da8e60ea343bdbd19c3350b3e",
"reference": "6ed08502a7c9559da8e60ea343bdbd19c3350b3e",
"url": "https://api.github.com/repos/symfony/process/zipball/86cdb930a6a855b0ab35fb60c1504cb36184f843",
"reference": "86cdb930a6a855b0ab35fb60c1504cb36184f843",
"shasum": ""
},
"require": {
@ -606,7 +802,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
"dev-master": "4.1-dev"
}
},
"autoload": {
@ -633,24 +829,25 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2018-02-19T12:18:43+00:00"
"time": "2018-08-03 11:13:38"
},
{
"name": "symfony/yaml",
"version": "v3.4.5",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb"
"reference": "b832cc289608b6d305f62149df91529a2ab3c314"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/6af42631dcf89e9c616242c900d6c52bd53bd1bb",
"reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb",
"url": "https://api.github.com/repos/symfony/yaml/zipball/b832cc289608b6d305f62149df91529a2ab3c314",
"reference": "b832cc289608b6d305f62149df91529a2ab3c314",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8"
"php": "^7.1.3",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
"symfony/console": "<3.4"
@ -664,7 +861,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
"dev-master": "4.1-dev"
}
},
"autoload": {
@ -691,7 +888,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2018-02-16T09:50:28+00:00"
"time": "2018-08-18 16:52:46"
},
{
"name": "webuni/commonmark-table-extension",
@ -750,35 +947,35 @@
"markdown",
"table"
],
"time": "2017-01-11T14:52:17+00:00"
"time": "2017-01-11 14:52:17"
},
{
"name": "webuni/front-matter",
"version": "1.0.0",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/webuni/front-matter.git",
"reference": "2c655c21e327e50708a847c5c6a4b52f1a111fdb"
"reference": "c7d1c51f9864ff015365ce515374e63bcd3b558e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webuni/front-matter/zipball/2c655c21e327e50708a847c5c6a4b52f1a111fdb",
"reference": "2c655c21e327e50708a847c5c6a4b52f1a111fdb",
"url": "https://api.github.com/repos/webuni/front-matter/zipball/c7d1c51f9864ff015365ce515374e63bcd3b558e",
"reference": "c7d1c51f9864ff015365ce515374e63bcd3b558e",
"shasum": ""
},
"require": {
"php": "^5.6|^7.0",
"symfony/yaml": "^2.3|^3.0"
"symfony/yaml": "^2.3|^3.0|^4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^1.9",
"mthaml/mthaml": "^1.2",
"friendsofphp/php-cs-fixer": "^2.9",
"mthaml/mthaml": "^1.3",
"nette/neon": "^2.2",
"phpunit/phpunit": "^5.4",
"sllh/php-cs-fixer-styleci-bridge": "^2.0",
"symfony/var-dumper": "^3.0",
"phpunit/phpunit": "^5.7|^6.0|^7.0",
"symfony/var-dumper": "^3.0|^4.0",
"twig/twig": "^1.27|^2.0",
"yosymfony/toml": "~0.3"
"vimeo/psalm": "^1.0",
"yosymfony/toml": "~0.3|^1.0"
},
"suggest": {
"nette/neon": "If you want to use NEON as front matter",
@ -787,7 +984,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
"dev-master": "1.2-dev"
}
},
"autoload": {
@ -818,7 +1015,7 @@
"toml",
"yaml"
],
"time": "2016-12-30T14:37:21+00:00"
"time": "2018-03-20 13:36:33"
}
],
"packages-dev": [
@ -874,7 +1071,7 @@
"constructor",
"instantiate"
],
"time": "2017-07-22T11:58:36+00:00"
"time": "2017-07-22 11:58:36"
},
{
"name": "mikey179/vfsStream",
@ -920,7 +1117,7 @@
],
"description": "Virtual file system to mock the real file system in unit tests.",
"homepage": "http://vfs.bovigo.org/",
"time": "2017-08-01T08:02:14+00:00"
"time": "2017-08-01 08:02:14"
},
{
"name": "phpdocumentor/reflection-common",
@ -974,7 +1171,7 @@
"reflection",
"static analysis"
],
"time": "2017-09-11T18:02:19+00:00"
"time": "2017-09-11 18:02:19"
},
{
"name": "phpdocumentor/reflection-docblock",
@ -1025,7 +1222,7 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2017-11-30T07:14:17+00:00"
"time": "2017-11-30 07:14:17"
},
{
"name": "phpdocumentor/type-resolver",
@ -1072,37 +1269,37 @@
"email": "me@mikevanriel.com"
}
],
"time": "2017-07-14T14:27:02+00:00"
"time": "2017-07-14 14:27:02"
},
{
"name": "phpspec/prophecy",
"version": "1.7.5",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401"
"reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401",
"reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
"reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
"sebastian/comparator": "^1.1|^2.0",
"sebastian/comparator": "^1.1|^2.0|^3.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.7.x-dev"
"dev-master": "1.8.x-dev"
}
},
"autoload": {
@ -1135,7 +1332,7 @@
"spy",
"stub"
],
"time": "2018-02-19T10:16:54+00:00"
"time": "2018-08-05 17:53:17"
},
{
"name": "phpunit/php-code-coverage",
@ -1198,7 +1395,7 @@
"testing",
"xunit"
],
"time": "2017-04-02T07:44:40+00:00"
"time": "2017-04-02 07:44:40"
},
{
"name": "phpunit/php-file-iterator",
@ -1245,7 +1442,7 @@
"filesystem",
"iterator"
],
"time": "2017-11-27T13:52:08+00:00"
"time": "2017-11-27 13:52:08"
},
{
"name": "phpunit/php-text-template",
@ -1286,7 +1483,7 @@
"keywords": [
"template"
],
"time": "2015-06-21T13:50:34+00:00"
"time": "2015-06-21 13:50:34"
},
{
"name": "phpunit/php-timer",
@ -1335,7 +1532,7 @@
"keywords": [
"timer"
],
"time": "2017-02-26T11:10:40+00:00"
"time": "2017-02-26 11:10:40"
},
{
"name": "phpunit/php-token-stream",
@ -1384,7 +1581,7 @@
"keywords": [
"tokenizer"
],
"time": "2017-11-27T05:48:46+00:00"
"time": "2017-11-27 05:48:46"
},
{
"name": "phpunit/phpunit",
@ -1466,7 +1663,7 @@
"testing",
"xunit"
],
"time": "2018-02-01T05:50:59+00:00"
"time": "2018-02-01 05:50:59"
},
{
"name": "phpunit/phpunit-mock-objects",
@ -1525,7 +1722,7 @@
"mock",
"xunit"
],
"time": "2017-06-30T09:13:00+00:00"
"time": "2017-06-30 09:13:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@ -1570,7 +1767,7 @@
],
"description": "Looks up which function or method a line of code belongs to",
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"time": "2017-03-04T06:30:41+00:00"
"time": "2017-03-04 06:30:41"
},
{
"name": "sebastian/comparator",
@ -1634,7 +1831,7 @@
"compare",
"equality"
],
"time": "2017-01-29T09:50:25+00:00"
"time": "2017-01-29 09:50:25"
},
{
"name": "sebastian/diff",
@ -1686,7 +1883,7 @@
"keywords": [
"diff"
],
"time": "2017-05-22T07:24:03+00:00"
"time": "2017-05-22 07:24:03"
},
{
"name": "sebastian/environment",
@ -1736,7 +1933,7 @@
"environment",
"hhvm"
],
"time": "2016-11-26T07:53:53+00:00"
"time": "2016-11-26 07:53:53"
},
{
"name": "sebastian/exporter",
@ -1803,7 +2000,7 @@
"export",
"exporter"
],
"time": "2016-11-19T08:54:04+00:00"
"time": "2016-11-19 08:54:04"
},
{
"name": "sebastian/global-state",
@ -1854,7 +2051,7 @@
"keywords": [
"global state"
],
"time": "2015-10-12T03:26:01+00:00"
"time": "2015-10-12 03:26:01"
},
{
"name": "sebastian/object-enumerator",
@ -1900,7 +2097,7 @@
],
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"time": "2017-02-18T15:18:39+00:00"
"time": "2017-02-18 15:18:39"
},
{
"name": "sebastian/recursion-context",
@ -1953,7 +2150,7 @@
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2016-11-19T07:33:16+00:00"
"time": "2016-11-19 07:33:16"
},
{
"name": "sebastian/resource-operations",
@ -1995,7 +2192,7 @@
],
"description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"time": "2015-07-28T20:34:47+00:00"
"time": "2015-07-28 20:34:47"
},
{
"name": "sebastian/version",
@ -2038,7 +2235,7 @@
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2016-10-03T07:35:21+00:00"
"time": "2016-10-03 07:35:21"
},
{
"name": "webmozart/assert",
@ -2088,7 +2285,7 @@
"check",
"validate"
],
"time": "2018-01-29T19:49:41+00:00"
"time": "2018-01-29 19:49:41"
}
],
"aliases": [],

View File

@ -80,17 +80,6 @@ To disable this, change the option in your config.json to `false`.
}
```
If you want to use the last modified time you can set the [format](http://php.net/manual/function.date.php) with the `date_modified_format` option.
```json
{
"html": {
"date_modified": true,
"date_modified_format": "l, F j, Y g:i A"
}
}
```
## GitHub Repo
Add a 'Fork me on GitHub' ribbon.

View File

@ -16,7 +16,6 @@
"breadcrumb_separator": "Chevrons",
"toggle_code": true,
"date_modified": true,
"date_modified_format": "l, F j, Y g:i A",
"float": true,
"inherit_index": true,

View File

@ -77,7 +77,6 @@
"breadcrumb_separator": "Chevrons",
"toggle_code": true,
"date_modified": false,
"date_modified_format": "l, F j, Y g:i A",
"float": false,
"auto_landing": true,
"search": true,

22
libs/FormatDate.php Normal file
View File

@ -0,0 +1,22 @@
<?php namespace Todaymade\Daux;
use IntlDateFormatter;
class FormatDate
{
public static function format($params, $date) {
$locale = $params['language'];
$datetype = IntlDateFormatter::LONG;
$timetype = IntlDateFormatter::SHORT;
$timezone = null;
if (!extension_loaded("intl")) {
$locale = 'en';
$timezone = 'GMT';
}
$formatter = new IntlDateFormatter($locale, $datetype, $timetype, $timezone);
return $formatter->format($date);
}
}

View File

@ -5,8 +5,7 @@
<h1><?= $page['breadcrumbs'] ? $this->get_breadcrumb_title($page, $base_page) : $page['title'] ?></h1>
<?php if ($params['html']['date_modified']) { ?>
<span class="ModifiedDate">
<?php $date_format = isset($params['html']['date_modified_format']) ? $params['html']['date_modified_format'] : 'l, F j, Y g:i A'; ?>
<?= date($date_format, $page['modified_time']); ?>
<?= Todaymade\Daux\FormatDate::format($params, $page['modified_time']) ?>
</span>
<?php } ?>
<?php