Reihen Page -- all kinds of stuff

This commit is contained in:
Simon Martens
2025-02-14 12:05:34 +01:00
parent 8d00f6a44d
commit 6aeb4c0548
18 changed files with 369 additions and 172 deletions

View File

@@ -1,6 +1,12 @@
package dbmodels
import "github.com/pocketbase/pocketbase/core"
import (
"slices"
"github.com/pocketbase/pocketbase/core"
"golang.org/x/text/collate"
"golang.org/x/text/language"
)
var _ core.RecordProxy = (*Agent)(nil)
@@ -109,3 +115,10 @@ func (a *Agent) SetEditState(editState string) {
func (a *Agent) Comment() string {
return a.GetString(COMMENT_FIELD)
}
func SortAgentsByName(series []*Agent) {
collator := collate.New(language.German)
slices.SortFunc(series, func(i, j *Agent) int {
return collator.CompareString(i.Name(), j.Name())
})
}