@@ -6,7 +6,7 @@ func (c *Carbon) StartOfCentury() *Carbon {
6
6
if c .IsInvalid () {
7
7
return c
8
8
}
9
- return create (c .Year ()/ YearsPerCentury * YearsPerCentury , 1 , 1 , 0 , 0 , 0 , 0 ). SetLocation ( c . loc )
9
+ return c . create (c .Year ()/ YearsPerCentury * YearsPerCentury , 1 , 1 , 0 , 0 , 0 , 0 )
10
10
}
11
11
12
12
// EndOfCentury returns a Carbon instance for end of the century.
@@ -15,7 +15,7 @@ func (c *Carbon) EndOfCentury() *Carbon {
15
15
if c .IsInvalid () {
16
16
return c
17
17
}
18
- return create (c .Year ()/ YearsPerCentury * YearsPerCentury + 99 , 12 , 31 , 23 , 59 , 59 , 999999999 ). SetLocation ( c . loc )
18
+ return c . create (c .Year ()/ YearsPerCentury * YearsPerCentury + 99 , 12 , 31 , 23 , 59 , 59 , 999999999 )
19
19
}
20
20
21
21
// StartOfDecade returns a Carbon instance for start of the decade.
@@ -24,7 +24,7 @@ func (c *Carbon) StartOfDecade() *Carbon {
24
24
if c .IsInvalid () {
25
25
return c
26
26
}
27
- return create (c .Year ()/ YearsPerDecade * YearsPerDecade , 1 , 1 , 0 , 0 , 0 , 0 ). SetLocation ( c . loc )
27
+ return c . create (c .Year ()/ YearsPerDecade * YearsPerDecade , 1 , 1 , 0 , 0 , 0 , 0 )
28
28
}
29
29
30
30
// EndOfDecade returns a Carbon instance for end of the decade.
@@ -33,7 +33,7 @@ func (c *Carbon) EndOfDecade() *Carbon {
33
33
if c .IsInvalid () {
34
34
return c
35
35
}
36
- return create (c .Year ()/ YearsPerDecade * YearsPerDecade + 9 , 12 , 31 , 23 , 59 , 59 , 999999999 ). SetLocation ( c . loc )
36
+ return c . create (c .Year ()/ YearsPerDecade * YearsPerDecade + 9 , 12 , 31 , 23 , 59 , 59 , 999999999 )
37
37
}
38
38
39
39
// StartOfYear returns a Carbon instance for start of the year.
@@ -42,7 +42,7 @@ func (c *Carbon) StartOfYear() *Carbon {
42
42
if c .IsInvalid () {
43
43
return c
44
44
}
45
- return create (c .Year (), 1 , 1 , 0 , 0 , 0 , 0 ). SetLocation ( c . loc )
45
+ return c . create (c .Year (), 1 , 1 , 0 , 0 , 0 , 0 )
46
46
}
47
47
48
48
// EndOfYear returns a Carbon instance for end of the year.
@@ -51,7 +51,7 @@ func (c *Carbon) EndOfYear() *Carbon {
51
51
if c .IsInvalid () {
52
52
return c
53
53
}
54
- return create (c .Year (), 12 , 31 , 23 , 59 , 59 , 999999999 ). SetLocation ( c . loc )
54
+ return c . create (c .Year (), 12 , 31 , 23 , 59 , 59 , 999999999 )
55
55
}
56
56
57
57
// StartOfQuarter returns a Carbon instance for start of the quarter.
@@ -61,7 +61,7 @@ func (c *Carbon) StartOfQuarter() *Carbon {
61
61
return c
62
62
}
63
63
year , quarter , day := c .Year (), c .Quarter (), 1
64
- return create (year , 3 * quarter - 2 , day , 0 , 0 , 0 , 0 ). SetLocation ( c . loc )
64
+ return c . create (year , 3 * quarter - 2 , day , 0 , 0 , 0 , 0 )
65
65
}
66
66
67
67
// EndOfQuarter returns a Carbon instance for end of the quarter.
@@ -77,7 +77,7 @@ func (c *Carbon) EndOfQuarter() *Carbon {
77
77
case 2 , 3 :
78
78
day = 30
79
79
}
80
- return create (year , 3 * quarter , day , 23 , 59 , 59 , 999999999 ). SetLocation ( c . loc )
80
+ return c . create (year , 3 * quarter , day , 23 , 59 , 59 , 999999999 )
81
81
}
82
82
83
83
// StartOfMonth returns a Carbon instance for start of the month.
@@ -87,7 +87,7 @@ func (c *Carbon) StartOfMonth() *Carbon {
87
87
return c
88
88
}
89
89
year , month , _ := c .Date ()
90
- return create (year , month , 1 , 0 , 0 , 0 , 0 ). SetLocation ( c . loc )
90
+ return c . create (year , month , 1 , 0 , 0 , 0 , 0 )
91
91
}
92
92
93
93
// EndOfMonth returns a Carbon instance for end of the month.
@@ -97,7 +97,7 @@ func (c *Carbon) EndOfMonth() *Carbon {
97
97
return c
98
98
}
99
99
year , month , _ := c .Date ()
100
- return create (year , month + 1 , 0 , 23 , 59 , 59 , 999999999 ). SetLocation ( c . loc )
100
+ return c . create (year , month + 1 , 0 , 23 , 59 , 59 , 999999999 )
101
101
}
102
102
103
103
// StartOfWeek returns a Carbon instance for start of the week.
@@ -133,7 +133,7 @@ func (c *Carbon) StartOfDay() *Carbon {
133
133
return c
134
134
}
135
135
year , month , day := c .Date ()
136
- return create (year , month , day , 0 , 0 , 0 , 0 ). SetLocation ( c . loc )
136
+ return c . create (year , month , day , 0 , 0 , 0 , 0 )
137
137
}
138
138
139
139
// EndOfDay returns a Carbon instance for end of the day.
@@ -143,7 +143,7 @@ func (c *Carbon) EndOfDay() *Carbon {
143
143
return c
144
144
}
145
145
year , month , day := c .Date ()
146
- return create (year , month , day , 23 , 59 , 59 , 999999999 ). SetLocation ( c . loc )
146
+ return c . create (year , month , day , 23 , 59 , 59 , 999999999 )
147
147
}
148
148
149
149
// StartOfHour returns a Carbon instance for start of the hour.
@@ -153,7 +153,7 @@ func (c *Carbon) StartOfHour() *Carbon {
153
153
return c
154
154
}
155
155
year , month , day := c .Date ()
156
- return create (year , month , day , c .Hour (), 0 , 0 , 0 ). SetLocation ( c . loc )
156
+ return c . create (year , month , day , c .Hour (), 0 , 0 , 0 )
157
157
}
158
158
159
159
// EndOfHour returns a Carbon instance for end of the hour.
@@ -163,7 +163,7 @@ func (c *Carbon) EndOfHour() *Carbon {
163
163
return c
164
164
}
165
165
year , month , day := c .Date ()
166
- return create (year , month , day , c .Hour (), 59 , 59 , 999999999 ). SetLocation ( c . loc )
166
+ return c . create (year , month , day , c .Hour (), 59 , 59 , 999999999 )
167
167
}
168
168
169
169
// StartOfMinute returns a Carbon instance for start of the minute.
@@ -173,7 +173,7 @@ func (c *Carbon) StartOfMinute() *Carbon {
173
173
return c
174
174
}
175
175
year , month , day , hour , minute , _ := c .DateTime ()
176
- return create (year , month , day , hour , minute , 0 , 0 ). SetLocation ( c . loc )
176
+ return c . create (year , month , day , hour , minute , 0 , 0 )
177
177
}
178
178
179
179
// EndOfMinute returns a Carbon instance for end of the minute.
@@ -183,7 +183,7 @@ func (c *Carbon) EndOfMinute() *Carbon {
183
183
return c
184
184
}
185
185
year , month , day , hour , minute , _ := c .DateTime ()
186
- return create (year , month , day , hour , minute , 59 , 999999999 ). SetLocation ( c . loc )
186
+ return c . create (year , month , day , hour , minute , 59 , 999999999 )
187
187
}
188
188
189
189
// StartOfSecond returns a Carbon instance for start of the second.
@@ -193,7 +193,7 @@ func (c *Carbon) StartOfSecond() *Carbon {
193
193
return c
194
194
}
195
195
year , month , day , hour , minute , second := c .DateTime ()
196
- return create (year , month , day , hour , minute , second , 0 ). SetLocation ( c . loc )
196
+ return c . create (year , month , day , hour , minute , second , 0 )
197
197
}
198
198
199
199
// EndOfSecond returns a Carbon instance for end of the second.
@@ -203,5 +203,5 @@ func (c *Carbon) EndOfSecond() *Carbon {
203
203
return c
204
204
}
205
205
year , month , day , hour , minute , second := c .DateTime ()
206
- return create (year , month , day , hour , minute , second , 999999999 ). SetLocation ( c . loc )
206
+ return c . create (year , month , day , hour , minute , second , 999999999 )
207
207
}
0 commit comments