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:
WithoutPants
2024-02-22 11:28:18 +11:00
committed by GitHub
parent 0c2a2190e5
commit a303446bb7
51 changed files with 3581 additions and 564 deletions

View File

@@ -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 {