Off-by-one error showing the date in timeline-ago?

When I view https://meta.discourse.org/t/admin-actions-goes-behind-the-titlebar/118649 (can’t post the link as I’m a new user) (or many other Discourse posts) I see this:

The start date in the timeline is May 25, but the date shown in the timeline-ago component when at 1/5 is May 26.

My computer (macOS 10.14.6, Safari 12.1.2) is in the Pacific/Auckland timezone. When I switch my computer to America/Los_Angeles I see the same issues, but all of the dates are one day backwards.

The timeline-ago date is set at https://github.com/discourse/discourse/blob/9a17b196365a1f9a5e88a0f8a36e2e35c56b39bc/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6#L84, and uses timelineDate to format the date. This is used to set the start-date and now-date, so it’s not likely to be the source of the issue.

From reading the code, position (L151-154) looks like it might be causing the issue, but I could be wrong, I’m brand new to the Discourse codebase and Ember.

1 Like

Topic is massively obsolete and thus deleted, but the date on first post is

<span title="May 24, 2019 11:14 pm" data-time="1558764857214" data-format="tiny" class="relative-date">May 24</span>

I think that is a localised timestamp? I see

<span title="May 25, 2019 6:14 pm" data-time="1558764857214" data-format="tiny" class="relative-date">May 25</span>

I’ve edited the post to make it clearer what the issue is.