# Paginate v2 3.0.0 date sorting problem

**URL:** <https://talk.jekyllrb.com/t/paginate-v2-3-0-0-date-sorting-problem/7609>\
**Category:** Help\
**Created:** [August 28, 2022, 5:46am UTC](https://talk.jekyllrb.com/t/paginate-v2-3-0-0-date-sorting-problem/7609 "2022-08-28T05:46:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arghc](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@arghc](https://talk.jekyllrb.com/u/arghc)\
**Post date:** [August 28, 2022, 5:46am UTC](https://talk.jekyllrb.com/t/paginate-v2-3-0-0-date-sorting-problem/7609/1 "2022-08-28T05:46:56Z")

</div>

I’m having basically [the same problem I had 3 years ago](https://talk.jekyllrb.com/t/paginate-v2-issues/2620). I am trying to sort posts on a field (start date) vs built in `post.date`.

When I set the `sort_field: 'date'`, it works as you’d expect. When I set it to my custom date field(`sort_field: 'startDate'`), the sorting is far more whimsical. I’ve published the [problematic site](https://knot-conference.org/blog/) along with debugging info in hopes of getting help (plus it’s low traffic and no one will care but me. 🕶 )

I have seen [this bug report from 2018](https://github.com/sverrirs/jekyll-paginate-v2/issues/43) but surely whatever the Jekyll sorting issue has been fixed in the intervening 4 years?

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [August 28, 2022, 11:37am UTC](https://talk.jekyllrb.com/t/paginate-v2-3-0-0-date-sorting-problem/7609/2 "2022-08-28T11:37:23Z")

</div>

> [@arghc](#):
>
> I have seen [this bug report from 2018](https://github.com/sverrirs/jekyll-paginate-v2/issues/43) but surely whatever the Jekyll sorting issue has been fixed in the intervening 4 years?

The author of that bug opened a new one in the Jekyll repo, and it boiled down to the fact that `Time` and `Date` types can’t be compared. Maybe that will help?:

[Error sorting by additional date with timestamp · Issue #6700 · jekyll/jekyll · GitHub](https://github.com/jekyll/jekyll/issues/6700)

---

<div class="post-metadata">

**Author:** ![arghc](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@arghc](https://talk.jekyllrb.com/u/arghc)\
**Post date:** [August 28, 2022, 7:03pm UTC](https://talk.jekyllrb.com/t/paginate-v2-3-0-0-date-sorting-problem/7609/3 "2022-08-28T19:03:18Z")

</div>

well, all my `startDate`s were `Date` so you’d think that they could be compared. Just went in and made them all `Time`s but that didn’t help with sorting accuracy

---

<div class="post-metadata">

**Author:** ![arghc](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@arghc](https://talk.jekyllrb.com/u/arghc)\
**Post date:** [August 29, 2022, 12:22am UTC](https://talk.jekyllrb.com/t/paginate-v2-3-0-0-date-sorting-problem/7609/4 "2022-08-29T00:22:56Z")

</div>

After talking it out with a friend, we realized that the sorting that I was getting was the exact same sorting as one would get if giving `sort_field: 'fieldThatDoesNotExist'`. While changing things around, I managed to trigger a build error that mentioned `sort!` in paginationModel.rb. Poking around some more I found a line that indicates that the field name gets downcased (and whitespace stripped out). So, if I change my field name from `startDate` to `startdate` it sorts properly. 😭

Therefore, jekyll-paginate-v2 does not sort on fields with names that have capital letters.
