@open-tender/utils 0.4.57 → 0.4.59
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.
|
@@ -147,7 +147,7 @@ const getRevenueCenterStatus = (revenueCenter, serviceType) => {
|
|
|
147
147
|
const serviceFirstTimes = first_times ? first_times[serviceType] : null;
|
|
148
148
|
if (!serviceFirstTimes)
|
|
149
149
|
return 'Closed';
|
|
150
|
-
const firstTimeDate = (0, date_fns_tz_1.utcToZonedTime)(
|
|
150
|
+
const firstTimeDate = (0, date_fns_tz_1.utcToZonedTime)(serviceFirstTimes.utc, tz);
|
|
151
151
|
const canOrderToday = (0, date_fns_1.isToday)(firstTimeDate);
|
|
152
152
|
if (canOrderToday)
|
|
153
153
|
return 'Currently closed, order for later today';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { serviceTypeNamesMap } from './constants';
|
|
2
2
|
import { fmtDate, formatDateStr, isoToDate, makeOrderTimes, makeReadableDateStrFromIso, makeWeekday, time24ToDate, timezoneMap } from './datetimes';
|
|
3
3
|
import { capitalize } from './helpers';
|
|
4
|
-
import { format,
|
|
4
|
+
import { format, isToday, isTomorrow } from 'date-fns';
|
|
5
5
|
import { utcToZonedTime } from 'date-fns-tz';
|
|
6
6
|
export const makeOrderAddress = (address) => {
|
|
7
7
|
const { street, unit, city, state, postal_code } = address || {};
|
|
@@ -136,7 +136,7 @@ export const getRevenueCenterStatus = (revenueCenter, serviceType) => {
|
|
|
136
136
|
const serviceFirstTimes = first_times ? first_times[serviceType] : null;
|
|
137
137
|
if (!serviceFirstTimes)
|
|
138
138
|
return 'Closed';
|
|
139
|
-
const firstTimeDate = utcToZonedTime(
|
|
139
|
+
const firstTimeDate = utcToZonedTime(serviceFirstTimes.utc, tz);
|
|
140
140
|
const canOrderToday = isToday(firstTimeDate);
|
|
141
141
|
if (canOrderToday)
|
|
142
142
|
return 'Currently closed, order for later today';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/utils",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.59",
|
|
4
4
|
"description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -60,10 +60,8 @@
|
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@open-tender/types": "^0.4.77",
|
|
62
62
|
"@reduxjs/toolkit": "^1.8.5",
|
|
63
|
-
"react": "^18.2.0"
|
|
64
|
-
},
|
|
65
|
-
"dependencies": {
|
|
66
63
|
"date-fns": "^2.29.3",
|
|
67
|
-
"date-fns-tz": "^1.3.7"
|
|
64
|
+
"date-fns-tz": "^1.3.7",
|
|
65
|
+
"react": "^18.2.0"
|
|
68
66
|
}
|
|
69
67
|
}
|