v0.0.396 sq.ConverterRFCSecondsF64ToString
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m2s

This commit is contained in:
2024-02-28 14:28:48 +01:00
parent 10c3780b52
commit 3956675e04
5 changed files with 19 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import (
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
"gogs.mikescher.com/BlackForestBytes/goext/langext"
"gogs.mikescher.com/BlackForestBytes/goext/rfctime"
"gogs.mikescher.com/BlackForestBytes/goext/timeext"
"reflect"
"strconv"
"strings"
@@ -114,6 +115,12 @@ var ConverterRFCTimeToString = NewDBTypeConverter[rfctime.Time, string](func(v r
return res, nil
})
var ConverterRFCSecondsF64ToString = NewDBTypeConverter[rfctime.SecondsF64, float64](func(v rfctime.SecondsF64) (float64, error) {
return v.Seconds(), nil
}, func(v float64) (rfctime.SecondsF64, error) {
return rfctime.NewSecondsF64(timeext.FromSeconds(v)), nil
})
var ConverterJsonObjToString = NewDBTypeConverter[JsonObj, string](func(v JsonObj) (string, error) {
mrsh, err := json.Marshal(v)
if err != nil {