Suche (cont.)

This commit is contained in:
Simon Martens
2025-02-18 11:01:46 +01:00
parent b07ac82be9
commit 44c7258a50
7 changed files with 165 additions and 21 deletions

View File

@@ -76,6 +76,28 @@ func HRDateShort(date string) string {
return ""
}
func HRDateYear(date string) string {
xsdt, err := xsdtime.New(date)
if err != nil {
return ""
}
t := xsdt.Type()
if t == xsdtime.GYear {
return strconv.Itoa(xsdt.Year)
}
if t == xsdtime.GYearMonth {
return strconv.Itoa(xsdt.Year)
}
if t == xsdtime.Date {
return strconv.Itoa(xsdt.Year)
}
return ""
}
func MonthName(i int) Month {
if i > 12 || i < 1 {
return TRANSLM[0]