Skip to content
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

docs: Update dates.md with an actual inline fix for Liquid #1745

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/docs/dates.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Sun Dec 31 2017 18:00:00 GMT-0600 (Central Standard Time)

Note that this appears to be the wrong day!

Nunjucks allows you to call JavaScript methods in output `{% raw %}{{ page.date.toString() }}{% endraw %}`. Liquid does not allow this.
Nunjucks allows you to call JavaScript methods in output `{% raw %}{{ page.date.toString() }}{% endraw %}`.

{% codetitle "Nunjucks", "Syntax" %}

Expand All @@ -120,7 +120,15 @@ display a date with a UTC time zone like:
Mon, 01 Jan 2018 00:00:00 GMT
```

You could add your own `toUTCString` [filter in Liquid](/docs/filters/) to perform the same task.
On Liquid, you can't do this, though you can create your own `toUTCString` [filter in Liquid](/docs/filters/) to perform the same task, or pass a timezone parameter to your filter to point to the one you desire in your template.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
On Liquid, you can't do this, though you can create your own `toUTCString` [filter in Liquid](/docs/filters/) to perform the same task, or pass a timezone parameter to your filter to point to the one you desire in your template.
On Liquid, you can't do this, though you can create your own `toUTCString` [filter in Liquid](/docs/languages/liquid/#filters) to perform the same task, or pass a timezone parameter to your filter to point to the one you desire in your template.

I think this specific link is closer to the link text.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I just kept the original one from the team as I didn't touch that part specifically. Mostly edit it so it made sense to the follow up advice.


The valid strings accepted are the [TZ identifiers](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

```
Given the date above this {% raw %}{{ page.date | date: '%b %d, %Y', 'UCT' }}{% endraw %} would render in UTC as:

Jan 01, 2018
```

### Also on YouTube

Expand Down