mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Scene play and o-counter history view and editing (#4532)
Co-authored-by: randemgame <61895715+randemgame@users.noreply.github.com>
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TimestampFormat = time.RFC3339
|
||||
|
||||
// Timestamp represents a time stored in RFC3339 format.
|
||||
type Timestamp struct {
|
||||
Timestamp time.Time
|
||||
@@ -18,7 +20,18 @@ func (t *Timestamp) Scan(value interface{}) error {
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (t Timestamp) Value() (driver.Value, error) {
|
||||
return t.Timestamp.Format(time.RFC3339), nil
|
||||
return t.Timestamp.Format(TimestampFormat), nil
|
||||
}
|
||||
|
||||
// UTCTimestamp stores a time in UTC.
|
||||
// TODO - Timestamp should use UTC by default
|
||||
type UTCTimestamp struct {
|
||||
Timestamp
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (t UTCTimestamp) Value() (driver.Value, error) {
|
||||
return t.Timestamp.Timestamp.UTC().Format(TimestampFormat), nil
|
||||
}
|
||||
|
||||
// NullTimestamp represents a nullable time stored in RFC3339 format.
|
||||
@@ -47,7 +60,7 @@ func (t NullTimestamp) Value() (driver.Value, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return t.Timestamp.Format(time.RFC3339), nil
|
||||
return t.Timestamp.Format(TimestampFormat), nil
|
||||
}
|
||||
|
||||
func (t NullTimestamp) TimePtr() *time.Time {
|
||||
|
||||
Reference in New Issue
Block a user