Skip to content

Commit cebc0bc

Browse files
committed
fix: date parsing
1 parent d986afa commit cebc0bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/content/queries/cs-variants.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ export const adapter = (config, variants) => variants.map(({ selections, product
5555
const today = new Date();
5656
const specialPriceToDate = new Date(specialToDate);
5757
if (specialPriceToDate.getTime() >= today.getTime()) {
58-
variant.specialToDate = specialToDate.substring(0, specialToDate.indexOf(' '));
58+
const [date] = specialToDate.split(' ');
59+
variant.specialToDate = date;
5960
}
6061
}
6162

0 commit comments

Comments
 (0)