Dashboard metrics form returns wrong date for "This week" filter

Created on 17 May 2024, about 1 month ago
Updated 3 June 2024, 26 days ago

Hello everyone,

Problem.

Just did a new install with Drupal 10 and commerce 2.39. Created a new order (today - 05-17-2024) and checked the new dashboard feature. When I hover on the "this week" button the period that appears is 05/19/2024 - 05/17/2024, the query also returns a wrong value for the orders. On my system settings I have Sunday defined as the first day of the week.

Solution

On the DashboardMetricsForm.php check if the "first day of the current week" is a date after the current date and in that case use the "first day of the last week". A patch is attached.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Order

Created by

🇵🇹Portugal nsalves

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024