Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 9d88433

Browse files
committed
Use more accurate Duration for Year and Month ranges
1 parent c0c514b commit 9d88433

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cointop/chart.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ func ChartRangesMap() map[string]time.Duration {
5252
return map[string]time.Duration{
5353
"All Time": time.Duration(24 * 7 * 4 * 12 * 5 * time.Hour),
5454
"YTD": time.Duration(1 * time.Second), // this will be calculated
55-
"1Y": time.Duration(24 * 7 * 4 * 12 * time.Hour),
56-
"6M": time.Duration(24 * 7 * 4 * 6 * time.Hour),
57-
"3M": time.Duration(24 * 7 * 4 * 3 * time.Hour),
58-
"1M": time.Duration(24 * 7 * 4 * time.Hour),
55+
"1Y": time.Duration(365 * 24 * time.Hour),
56+
"6M": time.Duration(365 / 2 * 24 * time.Hour),
57+
"3M": time.Duration(365 / 4 * 24 * time.Hour),
58+
"1M": time.Duration(365 / 12 * 24 * time.Hour),
5959
"7D": time.Duration(24 * 7 * time.Hour),
6060
"3D": time.Duration(24 * 3 * time.Hour),
6161
"24H": time.Duration(24 * time.Hour),

0 commit comments

Comments
 (0)