Skip to content

Commit

Permalink
It is now possible to manually specify a format for the datetime fi…
Browse files Browse the repository at this point in the history
…eld (fixes getgrav/grav#1261)
  • Loading branch information
w00fz committed Jan 20, 2017
1 parent 81b7dd1 commit d6afa39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# v1.2.10
## 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)
* Fixed issue with downloaded package when installing a testing release

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% set value = (value is null ? field.default : 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 value = (value is null ? value : value|date(php_dateformat)) %}

Expand Down

0 comments on commit d6afa39

Please sign in to comment.