Analytics chart data bumped up when previous year contains 29th February #47503
Labels
focus: analytics
plugin: woocommerce
Issues related to the WooCommerce Core plugin.
priority: normal
The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc.
team: TBD
Issues in areas where there is no team doing active development.
type: bug
The issue is a confirmed bug.
Issue description
Recreated from previous issue #32259.
Analytics time-comparison chart's previous year data will exclude 29 February when:
By day
This means reports such as quarterly reports, half-yearly reports, and annual reports can be affected if February 29 is present in the date range OR the respective comparison year, e.g. reports in 2024 and 2025 are affected.
Note: There's a challenge with the way we're rendering our charts, it only accepts a valid date in the x-axis. The x-axis is mapped via primary date range, thus 29th February of a given non-leap year will always be invalid. This means a quick solution such as adding a dummy datapoint in place of 29th February is also impossible without customizing how we render the x-axis with D3.js.
To reproduce:
Analytics > Settings
and setDate type
toDate created
and saveAnalytics > Orders
and setDate range
to custom tab,01/01/2021
to03/31/2021
and updateAcceptance criteria
The text was updated successfully, but these errors were encountered: