mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
value formula passing test
This commit is contained in:
@@ -277,3 +277,13 @@ func (wd WeekDays) Serialize(sep string) string {
|
||||
}
|
||||
return wdStr
|
||||
}
|
||||
|
||||
func DaysInMonth(year int, month time.Month) float64 {
|
||||
return float64(time.Date(year, month, 1, 0, 0, 0, 0, time.UTC).AddDate(0, 1, -1).Day())
|
||||
}
|
||||
|
||||
func DaysInYear(year int) float64 {
|
||||
first := time.Date(year, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
last := first.AddDate(1, 0, 0)
|
||||
return float64(last.Sub(first).Hours() / 24)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user