@softwear/latestcollectioncore 1.0.113 → 1.0.115

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.
@@ -408,7 +408,7 @@ const getDateRangeFromDatePair = function (inputDates) {
408
408
  fromDate.setSeconds(fromDate.getSeconds());
409
409
  const toDate = new Date(Date.parse(dates[1]));
410
410
  const beginTimeStamp = fromDate.getTime();
411
- const endTimeStamp = toDate.getTime();
411
+ const endTimeStamp = toDate.getTime() + 24 * 3600 * 1000;
412
412
  const timeFrame = endTimeStamp - beginTimeStamp;
413
413
  return {
414
414
  beginTimeStamp,
package/dist/edifact.js CHANGED
@@ -12,7 +12,9 @@ const skusToPricat = function (skus, fromGLN, toGLN, supplierGLN, refID, date) {
12
12
  return [];
13
13
  if (typeof date != 'string' || date.length != 8)
14
14
  return [];
15
- const brand = skus[0]?.brand;
15
+ if (!skus[0])
16
+ return [];
17
+ const brand = skus[0].brand;
16
18
  if (!brand)
17
19
  return [];
18
20
  if (!skus.every((sku) => sku.brand == brand))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.113",
3
+ "version": "1.0.115",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -498,7 +498,7 @@ const getDateRangeFromDatePair = function (inputDates: string[]): HrTimeframeI {
498
498
 
499
499
  const toDate = new Date(Date.parse(dates[1]))
500
500
  const beginTimeStamp = fromDate.getTime()
501
- const endTimeStamp = toDate.getTime()
501
+ const endTimeStamp = toDate.getTime() + 24 * 3600 * 1000
502
502
  const timeFrame = endTimeStamp - beginTimeStamp
503
503
  return {
504
504
  beginTimeStamp,
package/src/edifact.ts CHANGED
@@ -8,7 +8,8 @@ const skusToPricat = function (skus: MarkedSkuI[], fromGLN: string, toGLN: strin
8
8
  if (typeof supplierGLN != 'string' || supplierGLN.length != 13) return []
9
9
  if (typeof refID != 'number' || !refID) return []
10
10
  if (typeof date != 'string' || date.length != 8) return []
11
- const brand = skus[0]?.brand
11
+ if (!skus[0]) return []
12
+ const brand = skus[0].brand
12
13
  if (!brand) return []
13
14
  if (!skus.every((sku) => sku.brand == brand)) return []
14
15
 
@@ -294,7 +294,7 @@ describe('articleStatus', () => {
294
294
  expect(dateRange.hrMonth).to.equal('2024-01')
295
295
  expect(dateRange.hrWeek).to.equal('2024-01')
296
296
  expect(dateRange.hrDay).to.equal('2024-01-01')
297
- expect(dateRange.timeFrame).to.equal(366 * 24 * 3600 * 1000)
297
+ expect(dateRange.timeFrame).to.equal(367 * 24 * 3600 * 1000)
298
298
  })
299
299
  })
300
300
  })