Return iso dates for everything date related from the api (#130)
Remove traces of unix timestamp Revert renaming reminder table column Fix staticcheck Remove unused table call Add migration for renaming reminders table Fix issues with using TimeStamp Fix lint Updated all created / updated fields to use TimeStamps Add comments Convert all created / updated fields to datetime Add time util package Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/api/pulls/130
This commit is contained in:
@ -18,6 +18,7 @@ package files
|
||||
|
||||
import (
|
||||
"code.vikunja.io/api/pkg/config"
|
||||
"code.vikunja.io/api/pkg/timeutil"
|
||||
"code.vikunja.io/web"
|
||||
"github.com/c2h5oh/datasize"
|
||||
"github.com/spf13/afero"
|
||||
@ -35,8 +36,8 @@ type File struct {
|
||||
|
||||
Created time.Time `xorm:"-" json:"created"`
|
||||
|
||||
CreatedUnix int64 `xorm:"created" json:"-"`
|
||||
CreatedByID int64 `xorm:"int(11) not null" json:"-"`
|
||||
CreatedUnix timeutil.TimeStamp `xorm:"created" json:"-"`
|
||||
CreatedByID int64 `xorm:"int(11) not null" json:"-"`
|
||||
|
||||
File afero.File `xorm:"-" json:"-"`
|
||||
// This ReadCloser is only used for migration purposes. Use with care!
|
||||
@ -65,7 +66,7 @@ func (f *File) LoadFileMetaByID() (err error) {
|
||||
if !exists {
|
||||
return ErrFileDoesNotExist{FileID: f.ID}
|
||||
}
|
||||
f.Created = time.Unix(f.CreatedUnix, 0)
|
||||
f.Created = f.CreatedUnix.ToTime()
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user