@open-tender/utils 0.4.42 → 0.4.43
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.
|
@@ -159,7 +159,9 @@ const getRevenueCenterStatus = (hours, firstTimes, serviceType, timezone) => {
|
|
|
159
159
|
const canOrderToday = (0, date_fns_1.isToday)(firstTimeDate);
|
|
160
160
|
if (canOrderToday)
|
|
161
161
|
return 'Currently Closed, Order for later today';
|
|
162
|
-
const nextAvailableDate = (0,
|
|
162
|
+
const nextAvailableDate = (0, date_fns_1.isTomorrow)(firstTimeDate)
|
|
163
|
+
? 'tomorrow'
|
|
164
|
+
: (0, date_fns_1.format)(firstTimeDate, 'EEEE');
|
|
163
165
|
return `Closed for the Day, Order for ${nextAvailableDate}`;
|
|
164
166
|
};
|
|
165
167
|
exports.getRevenueCenterStatus = getRevenueCenterStatus;
|
|
@@ -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 { isAfter, isBefore, format, set, parseISO, isToday } from 'date-fns';
|
|
4
|
+
import { isAfter, isBefore, format, set, parseISO, 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 || {};
|
|
@@ -148,6 +148,8 @@ export const getRevenueCenterStatus = (hours, firstTimes, serviceType, timezone)
|
|
|
148
148
|
const canOrderToday = isToday(firstTimeDate);
|
|
149
149
|
if (canOrderToday)
|
|
150
150
|
return 'Currently Closed, Order for later today';
|
|
151
|
-
const nextAvailableDate =
|
|
151
|
+
const nextAvailableDate = isTomorrow(firstTimeDate)
|
|
152
|
+
? 'tomorrow'
|
|
153
|
+
: format(firstTimeDate, 'EEEE');
|
|
152
154
|
return `Closed for the Day, Order for ${nextAvailableDate}`;
|
|
153
155
|
};
|
package/package.json
CHANGED