Search: Add link on date to view photos taken on the same day #4273

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-05-20 12:56:38 +02:00
parent fb8001c5b0
commit 0df3feb4f1
18 changed files with 180 additions and 44 deletions

View File

@@ -8,8 +8,6 @@ import (
"time"
"unicode"
"github.com/araddon/dateparse"
"github.com/photoprism/photoprism/pkg/clean"
"github.com/photoprism/photoprism/pkg/txt"
)
@@ -126,8 +124,8 @@ func Unserialize(f SearchForm, q string) (result error) {
if fieldName != "" && fieldName != "-" && field.CanSet() {
switch field.Interface().(type) {
case time.Time:
if timeValue, err := dateparse.ParseAny(stringValue); err != nil {
result = err
if timeValue := txt.ParseTimeUTC(stringValue); stringValue != "" && timeValue.IsZero() {
result = fmt.Errorf("invalid %s date", formName)
} else {
field.Set(reflect.ValueOf(timeValue))
}