Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Nov 25, 2024
1 parent a549f15 commit fbe244a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions database_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,13 @@ func TestCarbon_Issue240(t *testing.T) {

// https://github.com/dromara/carbon/issues/243
func TestCarbon_Issue243(t *testing.T) {
SetDefault(Default{
Layout: DateTimeLayout,
Timezone: PRC,
Locale: "en",
WeekStartsAt: Sunday,
})

type Project struct {
StartDate DateTime `gorm:"column:start_date" json:"startDate"`
EndDate DateTime `gorm:"column:end_date" json:"endDate"`
Expand All @@ -924,6 +931,7 @@ func TestCarbon_Issue243(t *testing.T) {
if err != nil {
log.Fatal(err)
}
fmt.Println("defaultTimezone", defaultTimezone)
assert.Equal(t, "PRC", project.StartDate.Location())
assert.Equal(t, "PRC", project.EndDate.Location())
}

0 comments on commit fbe244a

Please sign in to comment.