Some clean-up in criteria package

This commit is contained in:
Deluan
2022-10-03 12:25:04 -04:00
parent 12b4a48842
commit bbd3882a75
4 changed files with 14 additions and 16 deletions
+8
View File
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"strings"
"time"
)
type unmarshalConjunctionType []Expression
@@ -115,3 +116,10 @@ func marshalConjunction(name string, conj []Expression) ([]byte, error) {
}
return json.Marshal(aux)
}
type date time.Time
func (t date) MarshalJSON() ([]byte, error) {
stamp := fmt.Sprintf(`"%s"`, time.Time(t).Format("2006-01-02"))
return []byte(stamp), nil
}