Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit ccf5769

Browse files
authored
Merge pull request #314 from afirlejczyk/feature/fix-checking-if-special-price-is-active
Fix checking if special price is active if no dates are set.
2 parents 589bb87 + 08813e6 commit ccf5769

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/taxcalc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
function isSpecialPriceActive (fromDate, toDate) {
2-
const now = new Date()
3-
fromDate = fromDate ? new Date(fromDate) : false
4-
toDate = toDate ? new Date(toDate) : false
5-
62
if (!fromDate && !toDate) {
73
return true
84
}
95

6+
const now = new Date()
7+
fromDate = fromDate ? new Date(fromDate) : false
8+
toDate = toDate ? new Date(toDate) : false
9+
1010
if (fromDate && toDate) {
1111
return fromDate < now && toDate > now
1212
}

0 commit comments

Comments
 (0)