Skip to content
Snippets Groups Projects
Commit a81db190 authored by Jonathan Sacksick's avatar Jonathan Sacksick
Browse files

Issue #3447901 by nsalves: Dashboard metrics form returns wrong date for "This week" filter.

parent 7f49a810
No related branches found
No related tags found
7 merge requests!418Issue #3511232 by ccjjmartin: Fix add to cart dropdown when only one non-default variation type is provided,!379Issue #3491248 Validation is breaking the amount number format decimal point,!375Issue #3413020 by czigor: Using a translatable string as a category for field...,!357Issue #2914933: Add service tags to order-related interfaces,!344Resolve #3107602 "Product attributes do not update visually when switching variations",!343Resolve #3107602 "Product attributes do not update visually when switching variations",!342Issue #3476581 by josephr5000: add OrderItemLabelEvent
Pipeline #176876 passed with warnings
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
*/ */
:root { :root {
--commerce--layout-sidebar-width: 22.5rem; --commerce--layout-sidebar-width: min(960px, 100%);
--commerce--layout-content-max-width: 52rem; --commerce--layout-content-max-width: min(1088px, 100%);
} }
.layout-region { .layout-region {
......
...@@ -140,6 +140,11 @@ class DashboardMetricsForm extends FormBase { ...@@ -140,6 +140,11 @@ class DashboardMetricsForm extends FormBase {
'month' => new DrupalDateTime('first day of this month'), 'month' => new DrupalDateTime('first day of this month'),
'year' => new DrupalDateTime('first day of january this year'), 'year' => new DrupalDateTime('first day of january this year'),
]; ];
// In case the first day of the week is sunday, the "week" date time object
// can be instantiated for the wrong week.
if ($periods['week'] > $periods['day']){
$periods['week'] = new DrupalDateTime(sprintf('%s last week', $first_day_of_week));
}
$periods = array_map(function (DrupalDateTime $date) use ($active_store) { $periods = array_map(function (DrupalDateTime $date) use ($active_store) {
$date->setTime(0, 0, 0); $date->setTime(0, 0, 0);
if ($active_store instanceof StoreInterface) { if ($active_store instanceof StoreInterface) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment