Skip to content

Commit a2cf69a

Browse files
LilithHafnerLilith Hafner
authored andcommitted
Remove unnecessary name qualification in examples (JuliaLang#45898)
Co-authored-by: Lilith Hafner <[email protected]>
1 parent 78116af commit a2cf69a

File tree

11 files changed

+77
-77
lines changed

11 files changed

+77
-77
lines changed

stdlib/Dates/src/Dates.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ For time zone functionality, see the TimeZones.jl package.
1414
julia> dt = DateTime(2017,12,31,23,59,59,999)
1515
2017-12-31T23:59:59.999
1616
17-
julia> d1 = Date(Dates.Month(12), Dates.Year(2017))
17+
julia> d1 = Date(Month(12), Year(2017))
1818
2017-12-01
1919
20-
julia> d2 = Date("2017-12-31", Dates.DateFormat("y-m-d"))
20+
julia> d2 = Date("2017-12-31", DateFormat("y-m-d"))
2121
2017-12-31
2222
23-
julia> Dates.yearmonthday(d2)
23+
julia> yearmonthday(d2)
2424
(2017, 12, 31)
2525
2626
julia> d2-d1

stdlib/Dates/src/accessors.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ week of 2004.
9797
9898
# Examples
9999
```jldoctest
100-
julia> Dates.week(Date(1989, 6, 22))
100+
julia> week(Date(1989, 6, 22))
101101
25
102102
103-
julia> Dates.week(Date(2005, 1, 1))
103+
julia> week(Date(2005, 1, 1))
104104
53
105105
106-
julia> Dates.week(Date(2004, 12, 31))
106+
julia> week(Date(2004, 12, 31))
107107
53
108108
```
109109
"""

stdlib/Dates/src/adjusters.jl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Truncates the value of `dt` according to the provided `Period` type.
2929
3030
# Examples
3131
```jldoctest
32-
julia> trunc(Dates.DateTime("1996-01-01T12:30:00"), Dates.Day)
32+
julia> trunc(DateTime("1996-01-01T12:30:00"), Day)
3333
1996-01-01T00:00:00
3434
```
3535
"""
@@ -43,7 +43,7 @@ Adjusts `dt` to the Monday of its week.
4343
4444
# Examples
4545
```jldoctest
46-
julia> Dates.firstdayofweek(DateTime("1996-01-05T12:30:00"))
46+
julia> firstdayofweek(DateTime("1996-01-05T12:30:00"))
4747
1996-01-01T00:00:00
4848
```
4949
"""
@@ -59,7 +59,7 @@ Adjusts `dt` to the Sunday of its week.
5959
6060
# Examples
6161
```jldoctest
62-
julia> Dates.lastdayofweek(DateTime("1996-01-05T12:30:00"))
62+
julia> lastdayofweek(DateTime("1996-01-05T12:30:00"))
6363
1996-01-07T00:00:00
6464
```
6565
"""
@@ -75,7 +75,7 @@ Adjusts `dt` to the first day of its month.
7575
7676
# Examples
7777
```jldoctest
78-
julia> Dates.firstdayofmonth(DateTime("1996-05-20"))
78+
julia> firstdayofmonth(DateTime("1996-05-20"))
7979
1996-05-01T00:00:00
8080
```
8181
"""
@@ -91,7 +91,7 @@ Adjusts `dt` to the last day of its month.
9191
9292
# Examples
9393
```jldoctest
94-
julia> Dates.lastdayofmonth(DateTime("1996-05-20"))
94+
julia> lastdayofmonth(DateTime("1996-05-20"))
9595
1996-05-31T00:00:00
9696
```
9797
"""
@@ -110,7 +110,7 @@ Adjusts `dt` to the first day of its year.
110110
111111
# Examples
112112
```jldoctest
113-
julia> Dates.firstdayofyear(DateTime("1996-05-20"))
113+
julia> firstdayofyear(DateTime("1996-05-20"))
114114
1996-01-01T00:00:00
115115
```
116116
"""
@@ -126,7 +126,7 @@ Adjusts `dt` to the last day of its year.
126126
127127
# Examples
128128
```jldoctest
129-
julia> Dates.lastdayofyear(DateTime("1996-05-20"))
129+
julia> lastdayofyear(DateTime("1996-05-20"))
130130
1996-12-31T00:00:00
131131
```
132132
"""
@@ -145,10 +145,10 @@ Adjusts `dt` to the first day of its quarter.
145145
146146
# Examples
147147
```jldoctest
148-
julia> Dates.firstdayofquarter(DateTime("1996-05-20"))
148+
julia> firstdayofquarter(DateTime("1996-05-20"))
149149
1996-04-01T00:00:00
150150
151-
julia> Dates.firstdayofquarter(DateTime("1996-08-20"))
151+
julia> firstdayofquarter(DateTime("1996-08-20"))
152152
1996-07-01T00:00:00
153153
```
154154
"""
@@ -168,10 +168,10 @@ Adjusts `dt` to the last day of its quarter.
168168
169169
# Examples
170170
```jldoctest
171-
julia> Dates.lastdayofquarter(DateTime("1996-05-20"))
171+
julia> lastdayofquarter(DateTime("1996-05-20"))
172172
1996-06-30T00:00:00
173173
174-
julia> Dates.lastdayofquarter(DateTime("1996-08-20"))
174+
julia> lastdayofquarter(DateTime("1996-08-20"))
175175
1996-09-30T00:00:00
176176
```
177177
"""
@@ -221,13 +221,13 @@ pursue before throwing an error (given that `f::Function` is never satisfied).
221221
222222
# Examples
223223
```jldoctest
224-
julia> Date(date -> Dates.week(date) == 20, 2010, 01, 01)
224+
julia> Date(date -> week(date) == 20, 2010, 01, 01)
225225
2010-05-17
226226
227-
julia> Date(date -> Dates.year(date) == 2010, 2000, 01, 01)
227+
julia> Date(date -> year(date) == 2010, 2000, 01, 01)
228228
2010-01-01
229229
230-
julia> Date(date -> Dates.month(date) == 10, 2000, 01, 01; limit = 5)
230+
julia> Date(date -> month(date) == 10, 2000, 01, 01; limit = 5)
231231
ERROR: ArgumentError: Adjustment limit reached: 5 iterations
232232
Stacktrace:
233233
[...]
@@ -248,10 +248,10 @@ pursue before throwing an error (in the case that `f::Function` is never satisfi
248248
249249
# Examples
250250
```jldoctest
251-
julia> DateTime(dt -> Dates.second(dt) == 40, 2010, 10, 20, 10; step = Dates.Second(1))
251+
julia> DateTime(dt -> second(dt) == 40, 2010, 10, 20, 10; step = Second(1))
252252
2010-10-20T10:00:40
253253
254-
julia> DateTime(dt -> Dates.hour(dt) == 20, 2010, 10, 20, 10; step = Dates.Hour(1), limit = 5)
254+
julia> DateTime(dt -> hour(dt) == 20, 2010, 10, 20, 10; step = Hour(1), limit = 5)
255255
ERROR: ArgumentError: Adjustment limit reached: 5 iterations
256256
Stacktrace:
257257
[...]
@@ -291,13 +291,13 @@ arguments are provided, the default step will be `Millisecond(1)` instead of `Se
291291
292292
# Examples
293293
```jldoctest
294-
julia> Dates.Time(t -> Dates.minute(t) == 30, 20)
294+
julia> Time(t -> minute(t) == 30, 20)
295295
20:30:00
296296
297-
julia> Dates.Time(t -> Dates.minute(t) == 0, 20)
297+
julia> Time(t -> minute(t) == 0, 20)
298298
20:00:00
299299
300-
julia> Dates.Time(t -> Dates.hour(t) == 10, 3; limit = 5)
300+
julia> Time(t -> hour(t) == 10, 3; limit = 5)
301301
ERROR: ArgumentError: Adjustment limit reached: 5 iterations
302302
Stacktrace:
303303
[...]

stdlib/Dates/src/periods.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,16 @@ Reduces the `CompoundPeriod` into its canonical form by applying the following r
250250
251251
# Examples
252252
```jldoctest
253-
julia> Dates.canonicalize(Dates.CompoundPeriod(Dates.Hour(12), Dates.Hour(13)))
253+
julia> canonicalize(Dates.CompoundPeriod(Dates.Hour(12), Dates.Hour(13)))
254254
1 day, 1 hour
255255
256-
julia> Dates.canonicalize(Dates.CompoundPeriod(Dates.Hour(-1), Dates.Minute(1)))
256+
julia> canonicalize(Dates.CompoundPeriod(Dates.Hour(-1), Dates.Minute(1)))
257257
-59 minutes
258258
259-
julia> Dates.canonicalize(Dates.CompoundPeriod(Dates.Month(1), Dates.Week(-2)))
259+
julia> canonicalize(Dates.CompoundPeriod(Dates.Month(1), Dates.Week(-2)))
260260
1 month, -2 weeks
261261
262-
julia> Dates.canonicalize(Dates.CompoundPeriod(Dates.Minute(50000)))
262+
julia> canonicalize(Dates.CompoundPeriod(Dates.Minute(50000)))
263263
4 weeks, 6 days, 17 hours, 20 minutes
264264
```
265265
"""

stdlib/Dates/src/query.jl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ Return 366 if the year of `dt` is a leap year, otherwise return 365.
9393
9494
# Examples
9595
```jldoctest
96-
julia> Dates.daysinyear(1999)
96+
julia> daysinyear(1999)
9797
365
9898
99-
julia> Dates.daysinyear(2000)
99+
julia> daysinyear(2000)
100100
366
101101
```
102102
"""
@@ -114,7 +114,7 @@ Return the day of the week as an [`Int64`](@ref) with `1 = Monday, 2 = Tuesday,
114114
115115
# Examples
116116
```jldoctest
117-
julia> Dates.dayofweek(Date("2000-01-01"))
117+
julia> dayofweek(Date("2000-01-01"))
118118
6
119119
```
120120
"""
@@ -159,10 +159,10 @@ the given `locale`. Also accepts `Integer`.
159159
160160
# Examples
161161
```jldoctest
162-
julia> Dates.dayname(Date("2000-01-01"))
162+
julia> dayname(Date("2000-01-01"))
163163
"Saturday"
164164
165-
julia> Dates.dayname(4)
165+
julia> dayname(4)
166166
"Thursday"
167167
```
168168
"""
@@ -179,10 +179,10 @@ in the given `locale`. Also accepts `Integer`.
179179
180180
# Examples
181181
```jldoctest
182-
julia> Dates.dayabbr(Date("2000-01-01"))
182+
julia> dayabbr(Date("2000-01-01"))
183183
"Sat"
184184
185-
julia> Dates.dayabbr(3)
185+
julia> dayabbr(3)
186186
"Wed"
187187
```
188188
"""
@@ -209,13 +209,13 @@ month, etc.` In the range 1:5.
209209
210210
# Examples
211211
```jldoctest
212-
julia> Dates.dayofweekofmonth(Date("2000-02-01"))
212+
julia> dayofweekofmonth(Date("2000-02-01"))
213213
1
214214
215-
julia> Dates.dayofweekofmonth(Date("2000-02-08"))
215+
julia> dayofweekofmonth(Date("2000-02-08"))
216216
2
217217
218-
julia> Dates.dayofweekofmonth(Date("2000-02-15"))
218+
julia> dayofweekofmonth(Date("2000-02-15"))
219219
3
220220
```
221221
"""
@@ -240,10 +240,10 @@ function.
240240
241241
# Examples
242242
```jldoctest
243-
julia> Dates.daysofweekinmonth(Date("2005-01-01"))
243+
julia> daysofweekinmonth(Date("2005-01-01"))
244244
5
245245
246-
julia> Dates.daysofweekinmonth(Date("2005-01-04"))
246+
julia> daysofweekinmonth(Date("2005-01-04"))
247247
4
248248
```
249249
"""
@@ -569,10 +569,10 @@ Return the full name of the month of the `Date` or `DateTime` or `Integer` in th
569569
570570
# Examples
571571
```jldoctest
572-
julia> Dates.monthname(Date("2005-01-04"))
572+
julia> monthname(Date("2005-01-04"))
573573
"January"
574574
575-
julia> Dates.monthname(2)
575+
julia> monthname(2)
576576
"February"
577577
```
578578
"""
@@ -588,7 +588,7 @@ Return the abbreviated month name of the `Date` or `DateTime` or `Integer` in th
588588
589589
# Examples
590590
```jldoctest
591-
julia> Dates.monthabbr(Date("2005-01-04"))
591+
julia> monthabbr(Date("2005-01-04"))
592592
"Jan"
593593
594594
julia> monthabbr(2)
@@ -606,13 +606,13 @@ Return the number of days in the month of `dt`. Value will be 28, 29, 30, or 31.
606606
607607
# Examples
608608
```jldoctest
609-
julia> Dates.daysinmonth(Date("2000-01"))
609+
julia> daysinmonth(Date("2000-01"))
610610
31
611611
612-
julia> Dates.daysinmonth(Date("2001-02"))
612+
julia> daysinmonth(Date("2001-02"))
613613
28
614614
615-
julia> Dates.daysinmonth(Date("2000-02"))
615+
julia> daysinmonth(Date("2000-02"))
616616
29
617617
```
618618
"""
@@ -626,10 +626,10 @@ Return `true` if the year of `dt` is a leap year.
626626
627627
# Examples
628628
```jldoctest
629-
julia> Dates.isleapyear(Date("2004"))
629+
julia> isleapyear(Date("2004"))
630630
true
631631
632-
julia> Dates.isleapyear(Date("2005"))
632+
julia> isleapyear(Date("2005"))
633633
false
634634
```
635635
"""

0 commit comments

Comments
 (0)