We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cbd886 commit 34da90fCopy full SHA for 34da90f
routes/payments/assets/plans.go
@@ -1,6 +1,9 @@
1
package assets
2
3
-import "popplio/types"
+import (
4
+ "popplio/types"
5
+ "time"
6
+)
7
8
var Plans = []types.PaymentPlan{
9
{
@@ -18,10 +21,17 @@ var Plans = []types.PaymentPlan{
18
21
Price: 4.99,
19
22
},
20
23
- ID: "gold",
- Name: "Gold Plan",
- Benefit: "1 year of premium",
24
- TimePeriod: 24 * 30 * 12,
25
- Price: 7.99,
+ ID: "gold",
+ 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,
36
37
}
0 commit comments