Skip to content

Commit 2b440b1

Browse files
committed
fix: Fix lose of values of layout, weekStartsAt, weekendDays and lang when create new carbon instance
1 parent c734bef commit 2b440b1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

creator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func CreateFromTimeNano(hour, minute, second, nanosecond int, timezone ...string
155155
return create(year, month, day, hour, minute, second, nanosecond, timezone...)
156156
}
157157

158-
// creates a Carbon instance from a given date, time and nanosecond.
158+
// creates a new Carbon instance from a given date, time and nanosecond.
159159
func create(year, month, day, hour, minute, second, nanosecond int, timezone ...string) *Carbon {
160160
var (
161161
tz string
@@ -173,7 +173,7 @@ func create(year, month, day, hour, minute, second, nanosecond int, timezone ...
173173
return NewCarbon(time.Date(year, time.Month(month), day, hour, minute, second, nanosecond, loc))
174174
}
175175

176-
// creates a Carbon instance from a given date, time and nanosecond.
176+
// creates a new Carbon instance from a given date, time and nanosecond based on the existing Carbon.
177177
func (c *Carbon) create(year, month, day, hour, minute, second, nanosecond int) *Carbon {
178178
return &Carbon{
179179
time: time.Date(year, time.Month(month), day, hour, minute, second, nanosecond, c.loc),

0 commit comments

Comments
 (0)