Skip to content

Commit

Permalink
feat(field): week func support set mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jack li committed Aug 17, 2024
1 parent 117fcee commit 81538d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions field/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ func (field Time) Month() Int {
}

// Week equal to WEEK(self)
func (field Time) Week() Int {
return Int{expr{e: clause.Expr{SQL: "WEEK(?)", Vars: []interface{}{field.RawExpr()}}}}
func (field Time) Week(mode int) Int {
return Int{expr{e: clause.Expr{SQL: fmt.Sprintf("WEEK(?, %d)", mode), Vars: []interface{}{field.RawExpr()}}}}
}

// Day equal to DAY(self)
Expand Down

0 comments on commit 81538d5

Please sign in to comment.