Skip to content

Commit

Permalink
Fix AddDate documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored and bep committed Jul 24, 2021
1 parent 78d7b52 commit 950fdab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/en/functions/adddate.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ link = "https://twitter.com/spf13"
date = "2017-01-07T00:00:00Z"
{{< /code-toggle >}}

Let's assume you want to grab Tweets from the last two years and present them in a random order. In conjunction with the [`where`](/functions/where/) and [`now`](/functions/now/) functions, you can limit our range to the last two years via `now.AddDate -2 0 0`, which represents a point in time 2 years, 0 days, and 0 hours before the time of your last site build.
Let's assume you want to grab Tweets from the last two years and present them in a random order. In conjunction with the [`where`](/functions/where/) and [`now`](/functions/now/) functions, you can limit our range to the last two years via `now.AddDate -2 0 0`, which represents a point in time 2 years, 0 months, and 0 days before the time of your last site build.

{{< code file="partials/templates/random-tweets.html" download="tweets.html" >}}
{{ range where $.Site.Data.tweets.tweet "date" "ge" (now.AddDate -2 0 0) | shuffle }}
Expand Down

0 comments on commit 950fdab

Please sign in to comment.