Skip to content

Commit 76a10f8

Browse files
committed
merge origin/master
1 parent 3328d1a commit 76a10f8

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

models/migrations/v93.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
package migrations
66

77
import (
8-
"code.gitea.io/gitea/modules/util"
9-
8+
"code.gitea.io/gitea/modules/timeutil"
109
"github.com/go-xorm/xorm"
1110
)
1211

@@ -33,9 +32,9 @@ func addProjectsTable(x *xorm.Engine) error {
3332

3433
Type ProjectType
3534

36-
ClosedDateUnix util.TimeStamp
37-
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
38-
UpdatedUnix util.TimeStamp `xorm:"INDEX updated"`
35+
ClosedDateUnix timeutil.TimeStamp
36+
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
37+
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
3938
}
4039

4140
type Issue struct {
@@ -50,8 +49,8 @@ func addProjectsTable(x *xorm.Engine) error {
5049
// Not really needed but helpful
5150
CreatorID int64 `xorm:"NOT NULL"`
5251

53-
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
54-
UpdatedUnix util.TimeStamp `xorm:"INDEX updated"`
52+
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
53+
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
5554
}
5655

5756
if err := x.Sync(new(Project)); err != nil {

models/projects.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package models
66

77
import (
88
"code.gitea.io/gitea/modules/setting"
9-
"code.gitea.io/gitea/modules/util"
9+
"code.gitea.io/gitea/modules/timeutil"
1010
"github.com/go-xorm/xorm"
1111
)
1212

@@ -22,8 +22,8 @@ type ProjectBoard struct {
2222
// Not really needed but helpful
2323
CreatorID int64 `xorm:"NOT NULL"`
2424

25-
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
26-
UpdatedUnix util.TimeStamp `xorm:"INDEX updated"`
25+
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
26+
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
2727
}
2828

2929
const (
@@ -76,9 +76,9 @@ type Project struct {
7676

7777
RenderedContent string `xorm:"-"`
7878

79-
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
80-
UpdatedUnix util.TimeStamp `xorm:"INDEX updated"`
81-
ClosedDateUnix util.TimeStamp
79+
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
80+
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
81+
ClosedDateUnix timeutil.TimeStamp
8282
}
8383

8484
// AfterLoad is invoked from XORM after setting the value of a field of
@@ -165,8 +165,8 @@ func createBoardsForProjectsType(sess *xorm.Session, project *Project) error {
165165

166166
for _, v := range items {
167167
boards = append(boards, ProjectBoard{
168-
CreatedUnix: util.TimeStampNow(),
169-
UpdatedUnix: util.TimeStampNow(),
168+
CreatedUnix: timeutil.TimeStampNow(),
169+
UpdatedUnix: timeutil.TimeStampNow(),
170170
CreatorID: project.CreatorID,
171171
Title: v,
172172
ProjectID: project.ID,

routers/repo/projects.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"code.gitea.io/gitea/modules/context"
1212
"code.gitea.io/gitea/modules/markup/markdown"
1313
"code.gitea.io/gitea/modules/setting"
14-
"code.gitea.io/gitea/modules/util"
14+
"code.gitea.io/gitea/modules/timeutil"
1515
)
1616

1717
const (
@@ -142,7 +142,7 @@ func ChangeProjectStatus(ctx *context.Context) {
142142
ctx.Redirect(ctx.Repo.RepoLink + "/projects?state=open")
143143
case "close":
144144
if !p.IsClosed {
145-
p.ClosedDateUnix = util.TimeStampNow()
145+
p.ClosedDateUnix = timeutil.TimeStampNow()
146146
if err = models.ChangeProjectStatus(p, true); err != nil {
147147
ctx.ServerError("ChangeProjectStatus", err)
148148
return

0 commit comments

Comments
 (0)