@tap-payments/os-micro-frontend-shared 0.1.374 → 0.1.375

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.
@@ -69,9 +69,11 @@ export const formatUTCOffset = (offset = 0) => {
69
69
  * @returns - Array of two dates [startDate, endDate]
70
70
  */
71
71
  export const getDefaultDateRange = (startDay = 6) => {
72
- const monthDaysMinus = dayjs().subtract(startDay, 'day').hour(0).minute(0).second(0).toDate();
73
- const today = dayjs(new Date()).hour(23).minute(59).second(59).toDate();
74
- return [monthDaysMinus, today];
72
+ const safeDays = Number.isFinite(startDay) && startDay >= 0 ? startDay : 0;
73
+ const now = dayjs();
74
+ const start = now.subtract(safeDays, 'day').startOf('day');
75
+ const end = now.endOf('day');
76
+ return [start.toDate(), end.toDate()];
75
77
  };
76
78
  export const getUTCTimestamp = (date) => {
77
79
  // Create a Date object with the local date string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.374",
4
+ "version": "0.1.375",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",