Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTatsushi Demachi <tdemachi@gmail.com>2015-01-21 16:52:12 +0300
committerbep <bjorn.erik.pedersen@gmail.com>2015-01-22 02:08:30 +0300
commit37490ee27af10f14aa40bd5e2ae39952b21ac1bb (patch)
tree7a81ca6a70da0c69cacefb7652c9d1d414e5a610 /docs
parent878754c21f7b91310bd80b48a7e676b3b1071504 (diff)
Add dateFormat template function
This is the implementation of the proposal at #235 and http://discuss.gohugo.io/t/parsing-dates-in-templates/603/3
Diffstat (limited to 'docs')
-rw-r--r--docs/content/templates/functions.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/content/templates/functions.md b/docs/content/templates/functions.md
index 89c866951..d84d8ad39 100644
--- a/docs/content/templates/functions.md
+++ b/docs/content/templates/functions.md
@@ -391,6 +391,11 @@ Replace all occurences of the search string with the replacement string.
e.g. `{{ replace "Batman and Robin" "Robin" "Catwoman" }}` → "Batman and Catwoman"
+### dateFormat
+Converts the textual representation of the datetime into the other form or returns it of Go `time.Time` type value. These are formatted with the layout string.
+
+e.g. `{{ dateFormat "Monday, Jan 2, 2006" "2015-01-21" }}` →"Wednesday, Jan 21, 2015"
+
### highlight
Take a string of code and a language, uses Pygments to return the syntax highlighted code in HTML. Used in the [highlight shortcode](/extras/highlighting).