@open-tender/utils 0.4.42 → 0.4.44

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.
@@ -158,8 +158,10 @@ const getRevenueCenterStatus = (hours, firstTimes, serviceType, timezone) => {
158
158
  const firstTimeDate = (0, date_fns_1.parseISO)(serviceFirstTimes.date);
159
159
  const canOrderToday = (0, date_fns_1.isToday)(firstTimeDate);
160
160
  if (canOrderToday)
161
- return 'Currently Closed, Order for later today';
162
- const nextAvailableDate = (0, datetimes_1.makeReadableDateStrFromIso)(serviceFirstTimes.utc, tz, true);
163
- return `Closed for the Day, Order for ${nextAvailableDate}`;
161
+ return 'Currently closed, order for later today';
162
+ const nextAvailableDate = (0, date_fns_1.isTomorrow)(firstTimeDate)
163
+ ? 'tomorrow'
164
+ : (0, date_fns_1.format)(firstTimeDate, 'EEEE');
165
+ return `Closed for today, 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 || {};
@@ -147,7 +147,9 @@ export const getRevenueCenterStatus = (hours, firstTimes, serviceType, timezone)
147
147
  const firstTimeDate = parseISO(serviceFirstTimes.date);
148
148
  const canOrderToday = isToday(firstTimeDate);
149
149
  if (canOrderToday)
150
- return 'Currently Closed, Order for later today';
151
- const nextAvailableDate = makeReadableDateStrFromIso(serviceFirstTimes.utc, tz, true);
152
- return `Closed for the Day, Order for ${nextAvailableDate}`;
150
+ return 'Currently closed, order for later today';
151
+ const nextAvailableDate = isTomorrow(firstTimeDate)
152
+ ? 'tomorrow'
153
+ : format(firstTimeDate, 'EEEE');
154
+ return `Closed for today, order for ${nextAvailableDate}`;
153
155
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.4.42",
3
+ "version": "0.4.44",
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",