Skip to content

Commit 7afab24

Browse files
lindskogenEdholm
authored andcommitted
Show ftg tickets that expire today
1 parent 0204f4d commit 7afab24

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

frontend/src/routes/SingleShowing/createPaymentOptions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { capitalize } from "../../Utils";
22
import moment from "moment";
3+
import { formatYMD } from "../../lib/dateTools";
34

45
const createPaymentOption = (
56
displayName,
@@ -15,12 +16,12 @@ const createPaymentOption = (
1516
};
1617

1718
const createForetagsbiljetter = foretagsbiljetter => {
18-
const now = moment();
19+
const now = formatYMD(moment());
1920

2021
return foretagsbiljetter
2122
.filter(
2223
({ status, expires }) =>
23-
status === "Available" && now.isBefore(moment(expires))
24+
status === "Available" && moment(expires).isSameOrAfter(now)
2425
)
2526
.map(({ number, expires }) =>
2627
createPaymentOption("Företagsbiljett", "foretagsbiljett", number, expires)

0 commit comments

Comments
 (0)