@darkpos/pricing 1.0.60 → 1.0.61

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.
@@ -31,7 +31,7 @@ describe('pickEndDate function', () => {
31
31
 
32
32
  const result = pricingService.store.pickEndDate(schedule);
33
33
 
34
- expect(result).toBe('2024-08-27T21:00:00Z'); // 2024-08-27 17:00:00 EDT
34
+ expect(result).toBe('2024-08-26T21:00:00Z'); // 2024-08-27 17:00:00 EDT
35
35
  });
36
36
 
37
37
  test('Order falls on a closed day', () => {
@@ -129,10 +129,10 @@ describe('pickEndDate function', () => {
129
129
 
130
130
  const result = pricingService.store.pickEndDate(schedule);
131
131
 
132
- expect(result).toBe('2024-08-27T21:00:00Z'); // 2024-08-27 17:00:00 EDT
132
+ expect(result).toBe('2024-08-26T21:00:00Z'); // 2024-08-26 17:00:00 EDT
133
133
  });
134
134
 
135
- test('Get EndDate, there are skip dates in between and endDate falls in a closed date', () => {
135
+ test('Get EndDate, Now date is an skip day', () => {
136
136
  const schedule = {
137
137
  addDays: 1,
138
138
  hour: 20,
@@ -147,6 +147,6 @@ describe('pickEndDate function', () => {
147
147
 
148
148
  const result = pricingService.store.pickEndDate(schedule);
149
149
 
150
- expect(result).toBe('2024-09-06T00:00:00Z'); // 2024-09-05 20:00:00 EDT
150
+ expect(result).toBe('2024-09-05T00:00:00Z'); // 2024-09-04 20:00:00 EDT
151
151
  });
152
152
  });
@@ -59,7 +59,10 @@ module.exports = ({ settings, _, moment }) => {
59
59
  isSkipDay(endDateTZ.isoWeekday()) ||
60
60
  isClosedDay(endDateTZ)
61
61
  ) {
62
- if (!isSkipDay(endDateTZ.isoWeekday()) && !isClosedDay(endDateTZ)) {
62
+ if (
63
+ endDateTZ.isSame(todayTZ, 'day') ||
64
+ (!isSkipDay(endDateTZ.isoWeekday()) && !isClosedDay(endDateTZ))
65
+ ) {
63
66
  addedDays += 1;
64
67
  }
65
68
  endDateTZ.add(1, 'days');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkpos/pricing",
3
- "version": "1.0.60",
3
+ "version": "1.0.61",
4
4
  "description": "Pricing calculator",
5
5
  "author": "Dark POS",
6
6
  "license": "ISC",
@@ -45,5 +45,5 @@
45
45
  "supertest": "^6.2.3",
46
46
  "supervisor": "^0.12.0"
47
47
  },
48
- "gitHead": "35464665224775509b837dfca3405adc2c7a881a"
48
+ "gitHead": "b84b082f63b719b2ad7a30e18aff3e4cb491a739"
49
49
  }