Skip to content

Commit 7b891b8

Browse files
authored
feat: add func WEEK
1 parent 05aa4db commit 7b891b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

field/time.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ func (field Time) Month() Int {
119119
return Int{expr{e: clause.Expr{SQL: "MONTH(?)", Vars: []interface{}{field.RawExpr()}}}}
120120
}
121121

122+
// Week equal to WEEK(self)
123+
func (field Time) WEEK() Int {
124+
return Int{expr{e: clause.Expr{SQL: "WEEK(?)", Vars: []interface{}{field.RawExpr()}}}}
125+
}
126+
122127
// Day equal to DAY(self)
123128
func (field Time) Day() Int {
124129
return Int{expr{e: clause.Expr{SQL: "DAY(?)", Vars: []interface{}{field.RawExpr()}}}}

0 commit comments

Comments
 (0)