mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-10-29 17:25:32 +00:00
Finsihed xml model & small bugfixes
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
package functions
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/Theodor-Springmann-Stiftung/lenz-web/helpers/xsdtime"
|
||||
)
|
||||
|
||||
type Month struct {
|
||||
Full string
|
||||
Short string
|
||||
@@ -54,50 +48,6 @@ var TRANSLD = []Weekday{
|
||||
{"Sonntag", "So", 7},
|
||||
}
|
||||
|
||||
func HRDateShort(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.Month) + "." + strconv.Itoa(xsdt.Year)
|
||||
}
|
||||
|
||||
if t == xsdtime.Date {
|
||||
return strconv.Itoa(xsdt.Day) + "." + strconv.Itoa(xsdt.Month) + "." + strconv.Itoa(xsdt.Year)
|
||||
}
|
||||
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user