# 'Top' sorting always defaults to Year time period

**URL:** <https://meta.discourse.org/t/top-sorting-always-defaults-to-year-time-period/119348>\
**Category:** Product Support\
**Created:** [03.Июнь.2019 05:31:19 UTC](https://meta.discourse.org/t/top-sorting-always-defaults-to-year-time-period/119348 "2019-06-03T05:31:19Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [04.Июнь.2019 08:58:11 UTC](https://meta.discourse.org/t/top-sorting-always-defaults-to-year-time-period/119348/4 "2019-06-04T08:58:11Z")

</div>

Turns out, this was broken since we added support for a default top timeframe. That value was overriding the date of the user’s previous visit instead of just being a default value when there was no previous visit (new user or anon).

[https://github.com/discourse/discourse/commit/33bc8c276d8db36513adf72a863db3d648613489](https://github.com/discourse/discourse/commit/33bc8c276d8db36513adf72a863db3d648613489)

While at it, I noticed another bug where a returning user would not be redirected to the proper timeframe due to a variable not being named properly on the client-side… 🤦‍♂️

[https://github.com/discourse/discourse/commit/b792db9d92dedd5bcd9386f4169fb6c4ee1b55aa](https://github.com/discourse/discourse/commit/b792db9d92dedd5bcd9386f4169fb6c4ee1b55aa)

Thanks @P16 for the report as we got to fix 2 bugs 🙌

---

_[View the full topic](https://meta.discourse.org/t/top-sorting-always-defaults-to-year-time-period/119348)._
