mirror of
https://github.com/safing/portmaster
synced 2025-09-17 02:09:41 +00:00
Add support for $gt, $ge, $lt, $le operators for netquery. Update DatetimeEncoder to support values specified in seconds
This commit is contained in:
parent
b35e4b9b72
commit
d96f841bef
2 changed files with 53 additions and 7 deletions
|
@ -156,6 +156,8 @@ func DatetimeEncoder(loc *time.Location) EncodeFunc {
|
|||
val = reflect.Indirect(val)
|
||||
}
|
||||
|
||||
normalizedKind := normalizeKind(valType.Kind())
|
||||
|
||||
// we only care about "time.Time" here
|
||||
var t time.Time
|
||||
switch {
|
||||
|
@ -179,6 +181,9 @@ func DatetimeEncoder(loc *time.Location) EncodeFunc {
|
|||
return nil, false, fmt.Errorf("failed to parse time as RFC3339: %w", err)
|
||||
}
|
||||
|
||||
case (normalizedKind == reflect.Int || normalizedKind == reflect.Uint || normalizedKind == reflect.Float32) && colDef.IsTime:
|
||||
t = time.Unix(val.Int(), 0)
|
||||
|
||||
default:
|
||||
// we don't care ...
|
||||
return nil, false, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue