jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Stats: Dates have a `0` appended

Open pjohanneson opened this issue 1 year ago • 5 comments

Impacted plugin

Jetpack

Quick summary

In the Jetpack stats on my site's backend, all the dates seem to have a 0 appended to the day of the month. eg. May 21 is displayed as May 210. I've attached a couple screenshots.

Screenshot showing the issue - Stats date

Screenshot showing the issue - Mouseover on a column

Steps to reproduce

View the Jetpack stats screen in a self-hosted WordPress site.

A clear and concise description of what you expected to happen.

I expected the dates to be formatted correctly.

What actually happened

A 0 is added to the day of the month on most instances of the date.

Impact

One

Available workarounds?

There is no user impact

Platform (Simple and/or Atomic)

No response

Logs or notes

No response

pjohanneson avatar May 21 '24 13:05 pjohanneson

Thanks for the report!

Could you go to Settings > General in your dashboard, and let us know what the date format settings are there? is there a 0 appended to the date format there maybe?

jeherve avatar May 21 '24 14:05 jeherve

Potentially related: #37444

jeherve avatar May 21 '24 14:05 jeherve

My site's date settings are F jS, Y. Screenshot 2024-05-21 at 09-18-27 General Settings ‹ Patrick Johanneson — WordPress

pjohanneson avatar May 21 '24 14:05 pjohanneson

Thank you! We'll take a look at this!

jeherve avatar May 21 '24 14:05 jeherve

Potentially related: #37444

Yeah, I noticed this issue before I posted mine, and when I noticed the 0 in the mouseover dates shown in #37444 I wondered if it might be somehow related. Thanks!

pjohanneson avatar May 21 '24 14:05 pjohanneson

Hey @pjohanneson 👋 — Are you still able to reproduce this?

I'm not able to reproduce in my testing so I'm wondering if it's possibly been fixed in recent updates to the Stats dashboard as there have been many. If you are still seeing it, can you please let me know the version of the Jetpack plugin you have installed and the language setting from Settings → General → Site Language?

Thanks!

a8ck3n avatar Sep 26 '24 13:09 a8ck3n

Notes:

  1. The date is generated based on the URL params. Either startDate=YYYY-MM-DD or undefined.
  2. If undefined, a date is generated based on the current period and the gmt_offset from the site options.
  3. When formatting the date for output, we do not respect the user preference in Settings → General. We currently default to the LL format as provided by Moment.js.

a8ck3n avatar Sep 26 '24 14:09 a8ck3n

It looks like a recent update has fixed the issue. I had noticed it sometime last week when I checked my stats, but today the dates appear normal (ie, "September 26", not "September 260"). I'm closing this now as it's been fixed. Thanks!

pjohanneson avatar Sep 26 '24 14:09 pjohanneson