Date filtering

+ Date filtering
+ Input styling
* Visual changes
+ Updated api calls
This commit is contained in:
2024-01-21 22:40:32 +02:00
parent 2776ad8e52
commit c8fa24f11c
6 changed files with 210 additions and 10 deletions

View File

@@ -79,7 +79,7 @@ func GetDiskGraphImage(hddID int, newerThan *time.Time, olderThan *time.Time) (*
// Fetch by a combination of fields
q := db.Where("id = ?", hddID)
if newerThan == nil && olderThan == nil {
if newerThan == nil || olderThan == nil {
q = q.Preload("Temperatures")
} else {
q = q.Preload("Temperatures", "time_stamp < ? AND time_stamp > ?", newerThan, olderThan)