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

When I view (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, 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.