1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 18:05:19 +02:00

fix release created timezone issue

This commit is contained in:
Unknwon 2015-08-24 21:01:23 +08:00
parent 0b97290c07
commit 87152f89ba
4 changed files with 14 additions and 3 deletions

View file

@ -10,6 +10,8 @@ import (
"strings"
"time"
"github.com/go-xorm/xorm"
"github.com/gogits/gogs/modules/git"
)
@ -37,6 +39,13 @@ type Release struct {
Created time.Time `xorm:"CREATED"`
}
func (r *Release) AfterSet(colName string, _ xorm.Cell) {
switch colName {
case "created":
r.Created = regulateTimeZone(r.Created)
}
}
// IsReleaseExist returns true if release with given tag name already exists.
func IsReleaseExist(repoId int64, tagName string) (bool, error) {
if len(tagName) == 0 {