@open-tender/utils 0.5.66 → 0.5.67

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.
@@ -105,8 +105,9 @@ const makeDiscountEnhanced = (item) => {
105
105
  };
106
106
  exports.makeDiscountEnhanced = makeDiscountEnhanced;
107
107
  const getIsDealExpired = (item) => {
108
- const { end_date } = item;
109
- return end_date ? (0, datetimes_1.dateStrToDate)(end_date) < new Date() : false;
108
+ const { end_at, end_date } = item;
109
+ const expiry = end_at || end_date;
110
+ return expiry ? (0, datetimes_1.dateStrToDate)(expiry) < new Date() : false;
110
111
  };
111
112
  exports.getIsDealExpired = getIsDealExpired;
112
113
  const getIsRewardExpired = (item) => {
@@ -99,8 +99,9 @@ export const makeDiscountEnhanced = (item) => {
99
99
  return Object.assign(Object.assign({}, item), { imageUrl, expiration, todayOnly, limitations });
100
100
  };
101
101
  export const getIsDealExpired = (item) => {
102
- const { end_date } = item;
103
- return end_date ? dateStrToDate(end_date) < new Date() : false;
102
+ const { end_at, end_date } = item;
103
+ const expiry = end_at || end_date;
104
+ return expiry ? dateStrToDate(expiry) < new Date() : false;
104
105
  };
105
106
  export const getIsRewardExpired = (item) => {
106
107
  const { end_at } = item;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.5.66",
3
+ "version": "0.5.67",
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",