Skip to content

Commit

Permalink
Provide example for calendar ordering (#712)
Browse files Browse the repository at this point in the history
Co-authored-by: Roger Marlow <[email protected]>
  • Loading branch information
rogermarlow and Roger Marlow authored Jun 25, 2024
1 parent 86d24d8 commit b360cf5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/extras/calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ If you set `:order` to `:desc`, you will get the page units in descendent order
in mind that you still have to desc-order the records in the collection since pagy has no control over that (indeed it's your own
collection scope).

```ruby controller
@calendar, @pagy, @records = pagy_calendar(collection.desc_scope,
year: {order: :desc},
month: {order: :desc})
```

### Beginning of week

If you use the `:week` time unit, consider that the first day of the week could be different for different locales.
Expand Down

0 comments on commit b360cf5

Please sign in to comment.