luuuis/jira-myzone

'Today' keyword appearing for issues created yesterday

Closed this issue · 8 comments

Minor detail: another site is 10 hours ahead of our site. A JIRA issue that was created at 1:30 pm yesterday is showing up as having been created at 1:30 pm today. Although the date for the site ahead of us was 'Today' it was yesterday for us. ;-)

I'm going to need some more information:

  1. what is the server time zone?
  2. what is the user's configured time zone?
  3. what is the reported server time (in the pop-up)?
  4. what is the reported user time?
  5. what time was it when the page was loaded (and in which time zone)?

Thanks Luis for looking at this issue so quickly.

  1. The server timezone is Australia/Sydney (GMT +11:00)
  2. The user's configured timezone is Amsterdam (GMT +01:00) (CET)
  3. Tool tip reported server time: Today 2:53 AM (so correct according to Sydney time)
  4. Reported user time Today: 4:53 PM CET (Should be yesterday according to CET)
  5. The page was loaded Today (Now 23) in CET (Amsterdam) timezone.

and we are using MyZone v1.1.2

  1. So 13:20 Amsterdam time.

Hmm, I'm not sure that "today" is incorrect? Here's my logic:

  • issue was created on Nov 24, 02:53 in Sydney
  • 02:53 in Sydney is 16:53 of the previous day in Amsterdam
  • so issue was created at 16:53 Nov 23 Amsterdam time

The page was loaded on Nov 23 Amsterdam time, therefore the issue was created "today" (Nov 23). Is that not right?

The issue was created 16:53 Nov 22 Amsterdam time/ 2:53 Nov 23 Sydney time. So 'today' should be 'yesterday' or Nov 22, because now it's Nov 23. ;-)

You're absolutely right, "Today" actually meant "<24hrs ago" because of a bug. Will be fixed in v1.1.3.

fixed incorrect relative date formatting

the "days ago" calculation used to determine whether to format dates as
Today/Yesterday was being made based on the time when the page was
loaded, instead of the end of the day. also enhanced the code so that it
correctly handles DST gaps, and added unit tests.

closed by e8cc8b7

Brilliant. Thanks Luis!