@yuuvis/client-core 2.3.27 → 2.3.28
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.
|
@@ -4891,27 +4891,21 @@ class SearchUtils {
|
|
|
4891
4891
|
switch (dateRange) {
|
|
4892
4892
|
case 'today': {
|
|
4893
4893
|
start = new Date();
|
|
4894
|
-
start.setHours(0, 0, 0, 0);
|
|
4895
4894
|
end = new Date();
|
|
4896
|
-
end.setHours(23, 59, 59, 999);
|
|
4897
4895
|
break;
|
|
4898
4896
|
}
|
|
4899
4897
|
case 'yesterday': {
|
|
4900
4898
|
const yesterday = new Date();
|
|
4901
4899
|
yesterday.setDate(yesterday.getDate() - 1);
|
|
4902
4900
|
start = yesterday;
|
|
4903
|
-
start.setHours(0, 0, 0, 0);
|
|
4904
4901
|
end = yesterday;
|
|
4905
|
-
end.setHours(23, 59, 59, 999);
|
|
4906
4902
|
break;
|
|
4907
4903
|
}
|
|
4908
4904
|
case 'thisWeek': {
|
|
4909
4905
|
const firstDay = new Date();
|
|
4910
4906
|
firstDay.setDate(firstDay.getDate() - firstDay.getDay());
|
|
4911
4907
|
start = firstDay;
|
|
4912
|
-
start.setHours(0, 0, 0, 0);
|
|
4913
4908
|
end = new Date();
|
|
4914
|
-
end.setHours(23, 59, 59, 999);
|
|
4915
4909
|
break;
|
|
4916
4910
|
}
|
|
4917
4911
|
case 'lastWeek': {
|
|
@@ -4920,18 +4914,14 @@ class SearchUtils {
|
|
|
4920
4914
|
const lastDay = new Date();
|
|
4921
4915
|
lastDay.setDate(lastDay.getDate() - lastDay.getDay() - 1);
|
|
4922
4916
|
start = firstDay;
|
|
4923
|
-
start.setHours(0, 0, 0, 0);
|
|
4924
4917
|
end = lastDay;
|
|
4925
|
-
end.setHours(23, 59, 59, 999);
|
|
4926
4918
|
break;
|
|
4927
4919
|
}
|
|
4928
4920
|
case 'thisMonth': {
|
|
4929
4921
|
const firstDay = new Date();
|
|
4930
4922
|
firstDay.setDate(1);
|
|
4931
4923
|
start = firstDay;
|
|
4932
|
-
start.setHours(0, 0, 0, 0);
|
|
4933
4924
|
end = new Date();
|
|
4934
|
-
end.setHours(23, 59, 59, 999);
|
|
4935
4925
|
break;
|
|
4936
4926
|
}
|
|
4937
4927
|
case 'lastMonth': {
|
|
@@ -4941,9 +4931,7 @@ class SearchUtils {
|
|
|
4941
4931
|
const lastDay = new Date();
|
|
4942
4932
|
lastDay.setDate(0);
|
|
4943
4933
|
start = firstDay;
|
|
4944
|
-
start.setHours(0, 0, 0, 0);
|
|
4945
4934
|
end = lastDay;
|
|
4946
|
-
end.setHours(23, 59, 59, 999);
|
|
4947
4935
|
break;
|
|
4948
4936
|
}
|
|
4949
4937
|
case 'thisYear': {
|
|
@@ -4951,9 +4939,7 @@ class SearchUtils {
|
|
|
4951
4939
|
firstDay.setMonth(0);
|
|
4952
4940
|
firstDay.setDate(1);
|
|
4953
4941
|
start = firstDay;
|
|
4954
|
-
start.setHours(0, 0, 0, 0);
|
|
4955
4942
|
end = new Date();
|
|
4956
|
-
end.setHours(23, 59, 59, 999);
|
|
4957
4943
|
break;
|
|
4958
4944
|
}
|
|
4959
4945
|
case 'lastYear': {
|
|
@@ -4966,12 +4952,14 @@ class SearchUtils {
|
|
|
4966
4952
|
lastDay.setMonth(11);
|
|
4967
4953
|
lastDay.setDate(31);
|
|
4968
4954
|
start = firstDay;
|
|
4969
|
-
start.setHours(0, 0, 0, 0);
|
|
4970
4955
|
end = lastDay;
|
|
4971
|
-
end.setHours(23, 59, 59, 999);
|
|
4972
4956
|
break;
|
|
4973
4957
|
}
|
|
4974
4958
|
}
|
|
4959
|
+
const startString = start.toISOString().split('T')[0] + 'T00:00:00.000Z';
|
|
4960
|
+
start = new Date(startString);
|
|
4961
|
+
const endString = end.toISOString().split('T')[0] + 'T23:59:59.999Z';
|
|
4962
|
+
end = new Date(endString);
|
|
4975
4963
|
return { start, end };
|
|
4976
4964
|
}
|
|
4977
4965
|
/**
|