Skip to content

Commit 34da90f

Browse files
author
Your Name
committed
fix days
1 parent 3cbd886 commit 34da90f

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

routes/payments/assets/plans.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package assets
22

3-
import "popplio/types"
3+
import (
4+
"popplio/types"
5+
"time"
6+
)
47

58
var Plans = []types.PaymentPlan{
69
{
@@ -18,10 +21,17 @@ var Plans = []types.PaymentPlan{
1821
Price: 4.99,
1922
},
2023
{
21-
ID: "gold",
22-
Name: "Gold Plan",
23-
Benefit: "1 year of premium",
24-
TimePeriod: 24 * 30 * 12,
25-
Price: 7.99,
24+
ID: "gold",
25+
Name: "Gold Plan",
26+
Benefit: "1 year of premium",
27+
TimePeriod: func() int {
28+
currentYear := time.Now().Year()
29+
if currentYear%4 == 0 && (currentYear%100 != 0 || currentYear%400 != 0) {
30+
return 366
31+
}
32+
33+
return 365
34+
}(),
35+
Price: 7.99,
2636
},
2737
}

0 commit comments

Comments
 (0)