summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/models/action.go b/models/action.go
index de7f93a973..0e336c372b 100644
--- a/models/action.go
+++ b/models/action.go
@@ -14,6 +14,8 @@ import (
"time"
"unicode"
+ "github.com/go-xorm/xorm"
+
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/log"
@@ -77,6 +79,13 @@ type Action struct {
Created time.Time `xorm:"created"`
}
+func (a *Action) AfterSet(colName string, _ xorm.Cell) {
+ switch colName {
+ case "created":
+ a.Created = a.Created.UTC()
+ }
+}
+
func (a Action) GetOpType() int {
return int(a.OpType)
}