Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Nov 3, 2024
1 parent 873c6c5 commit 3cc2a71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules/templates/util_date.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ func timeSinceLegacy(time any, _ ...any) template.HTML {

func anyToTime(any any) (t time.Time, isZero bool) {
switch v := any.(type) {
case nil:
// it is zero
case time.Time:
t = v
case timeutil.TimeStamp:
Expand Down
2 changes: 1 addition & 1 deletion modules/templates/util_date_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestDateTime(t *testing.T) {
defer test.MockVariableValue(&setting.DefaultUILocation, testTz)()
defer test.MockVariableValue(&setting.IsInTesting, false)()

du := NewDateUtils(nil)
du := NewDateUtils()

refTimeStr := "2018-01-01T00:00:00Z"
refDateStr := "2018-01-01"
Expand Down

0 comments on commit 3cc2a71

Please sign in to comment.