mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-03 11:55:52 +01:00
It is now possible to manually specify a format for the datetime field (fixes getgrav/grav#1261)
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
# v1.2.10
|
# v1.2.10
|
||||||
## XX/XX/2017
|
## XX/XX/2017
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* It is now possible to manually specify a format for the `datetime` field [#1261](https://github.com/getgrav/grav/issues/1261)
|
||||||
1. [](#bugfix)
|
1. [](#bugfix)
|
||||||
* Fixed issue with downloaded package when installing a testing release
|
* Fixed issue with downloaded package when installing a testing release
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% set value = (value is null ? field.default : value) %}
|
{% set value = (value is null ? field.default : value) %}
|
||||||
{% set default_php_dateformat = admin.guessDateFormat(value) %}
|
{% set default_php_dateformat = admin.guessDateFormat(value) %}
|
||||||
{% set php_dateformat = admin.page.dateformat ?: config.system.pages.dateformat.default ?: default_php_dateformat %}
|
{% set php_dateformat = field.format ?: admin.page.dateformat ?: config.system.pages.dateformat.default ?: default_php_dateformat %}
|
||||||
{% set js_dateformat = admin.dateformatToMomentJS(php_dateformat) %}
|
{% set js_dateformat = admin.dateformatToMomentJS(php_dateformat) %}
|
||||||
{% set value = (value is null ? value : value|date(php_dateformat)) %}
|
{% set value = (value is null ? value : value|date(php_dateformat)) %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user