#157 Calendar Pagination with gem Pagy
We are all used to pagination by clicking a prev or next page link.
But what if we could paginate by year/month/day?
Some time ago I asked Domizio Demichelis (@ddnexus), the creator of Pagy gem, this question. And it resulted in the creation of Pagy::Calendar!
Let's explore how we can add calendar pagination to our app and make it useable.
Episode source code: https://github.com/corsego/157-pagy-calendar/commit/008a13dee887e57a5d6b8c81240950677adf9020
Based on this blogpost: https://blog.corsego.com/pagy-calendar-pagination
0:00 Calendar pagination demo
02:20 Install Pagy Calendar
6:58 Tailwind styling
7:56 Paginate by year/month/week/day
11:08 Toggle calendar and normal pagination
12:58 Create an event for current date
17:04 Fix bug with max year being wrong
19:25 redirect back to page in calendar
22:11 link to Today
0
Featured in playlists
![#101 iCalendar and .ics format. Add events to calendar](https://superails.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTgyOSwicHVyIjoiYmxvYl9pZCJ9fQ==--54a7459d4e69c08a30404b891d4a2a73d9af4882/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fbGltaXQiOls0MDAsNjAwXX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--2d7cd3a4d9675c7f4c17dad7856d799792bd3595/maxresdefault.jpg)
![#102 Email Calendar Invite](https://superails.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTgzNiwicHVyIjoiYmxvYl9pZCJ9fQ==--a7a52a12ac31ed0ac3f57d5919f67ccadfed09e4/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fbGltaXQiOls0MDAsNjAwXX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--2d7cd3a4d9675c7f4c17dad7856d799792bd3595/maxresdefault.jpg)
![#104 Remote Calendar Subscription with WEBCAL](https://superails.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTkwMSwicHVyIjoiYmxvYl9pZCJ9fQ==--4e2371e8b18c30d56e24e9263730067accbf73a6/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fbGltaXQiOls0MDAsNjAwXX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--2d7cd3a4d9675c7f4c17dad7856d799792bd3595/maxresdefault.jpg)
Do you work at 37signals?
Are you building a calendar?
Are you facing a deadline?
This series is for you! π