mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 20:14:58 +00:00
tpl/time: Re-add the time example
This commit is contained in:
1 parent
1f9e8dcc60
commit
a119ef693f
2 files changed
+9
-4
No files matched your search
+2
-4
@@ -1439,12 +1439,10 @@
|
|||||||
"Args": [
|
"Args": [
|
||||||
"v"
|
"v"
|
||||||
],
|
],
|
||||||
"Aliases": [
|
"Aliases": null,
|
||||||
"asTime"
|
|
||||||
],
|
|
||||||
"Examples": [
|
"Examples": [
|
||||||
[
|
[
|
||||||
"{{ (asTime \"2015-01-21\").Year }}",
|
"{{ (time \"2015-01-21\").Year }}",
|
||||||
"2015"
|
"2015"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -58,6 +58,13 @@ func init() {
|
|||||||
[][2]string{},
|
[][2]string{},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ns.AddMethodMapping(ctx.AsTime,
|
||||||
|
nil,
|
||||||
|
[][2]string{
|
||||||
|
{`{{ (time "2015-01-21").Year }}`, `2015`},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
return ns
|
return ns
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user