-
-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use page.date.toUTCString()
in Liquid template
#603
Comments
I was able to reproduce this in Liquid but Nunjucks seems to operate just fine. |
page.date.toUTCString()
in templatepage.date.toUTCString()
in Liquid template
Hmm, I’m not sure this is a bug—I don’t think Liquid supports calling functions like this. I will update the documentation to be more accurate—sorry about that! |
(The accepted method for this in Liquid is to use a custom filter to output the correct string format for the date ) |
Docs updated! https://www.11ty.io/docs/dates/#dates-off-by-one-day |
Describe the bug
The docs on using dates in templates (https://www.11ty.io/docs/dates/) suggests using
{{ page.date.toUTCString() }}
to display a UTC time zone date, but when I try to do that it displaysfunction toUTCString() { [native code] }
instead of the actual date.To Reproduce
Steps to reproduce the behavior:
{{ page.date.toUTCString() }}
in your templateExpected behavior
It should display the date.
Screenshots
Environment:
Additional context
I'm using the default template engine (liquid) but I've also tried using nunjucks. I also get the same results for
toString()
. Seems related to #447The text was updated successfully, but these errors were encountered: