contentoh-components-library 21.2.17 → 21.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -64,10 +64,11 @@ var DashboardMetric = function DashboardMetric(_ref) {
|
|
|
64
64
|
|
|
65
65
|
(0, _react.useEffect)(function () {
|
|
66
66
|
var today = new Date();
|
|
67
|
-
var
|
|
68
|
-
var start =
|
|
67
|
+
var diff = today.getDate() - today.getDay();
|
|
68
|
+
var start = new Date(today.setDate(diff));
|
|
69
69
|
var end = new Date();
|
|
70
|
-
|
|
70
|
+
console.log(diff, today.getDay() === 0 ? -6 : 1);
|
|
71
|
+
setStartDate(start);
|
|
71
72
|
setEndDate(end);
|
|
72
73
|
}, []);
|
|
73
74
|
|
package/package.json
CHANGED
|
@@ -15,9 +15,8 @@ export const DashboardMetric = ({
|
|
|
15
15
|
displayScale = false,
|
|
16
16
|
retailers = [],
|
|
17
17
|
setQueryObject,
|
|
18
|
-
queryObject
|
|
18
|
+
queryObject,
|
|
19
19
|
}) => {
|
|
20
|
-
|
|
21
20
|
const onChangeRetailer = (e) => {
|
|
22
21
|
setQueryObject({ ...queryObject, retailerId: e.target.value });
|
|
23
22
|
};
|
|
@@ -27,12 +26,11 @@ export const DashboardMetric = ({
|
|
|
27
26
|
|
|
28
27
|
useEffect(() => {
|
|
29
28
|
const today = new Date();
|
|
30
|
-
const
|
|
31
|
-
const start =
|
|
32
|
-
today.getMonth() + 1
|
|
33
|
-
}-${firstWeekDay}`;
|
|
29
|
+
const diff = today.getDate() - today.getDay();
|
|
30
|
+
const start = new Date(today.setDate(diff));
|
|
34
31
|
const end = new Date();
|
|
35
|
-
|
|
32
|
+
console.log(diff, today.getDay() === 0 ? -6 : 1);
|
|
33
|
+
setStartDate(start);
|
|
36
34
|
setEndDate(end);
|
|
37
35
|
}, []);
|
|
38
36
|
|