Skip to content

Commit 6bff923

Browse files
committed
Added usage statements to Dateish.pod
1 parent b264497 commit 6bff923

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

lib/Type/Dateish.pod

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,61 +14,115 @@ calculating the day of the week.
1414
1515
=head2 method year
1616
17+
Defined as:
18+
1719
method year(Date:D:) returns Int:D
1820
21+
Usage:
22+
23+
DATEISH.year
24+
1925
Returns the year of the date
2026
2127
=head2 method month
2228
29+
Defined as:
30+
2331
method month(Date:D:) returns Int:D
2432
33+
Usage:
34+
35+
DATEISH.month
36+
2537
Returns the month of the date (1..12)
2638
2739
=head2 method day
2840
41+
Defined as:
42+
2943
method day(Date:D:) returns Int:D
3044
45+
Usage:
46+
47+
DATEISH.day
48+
3149
Returns the day of the month of the date (1..31)
3250
3351
3452
=head2 method is-leap-year
3553
54+
Defined as:
55+
3656
method is-leap-year($year = self.year) returns Bool:D
3757
58+
Usage:
59+
60+
DATEISH.is-leap-year(YEAR?)
61+
3862
Returns C<True> if C<$year> is a leap year. Can be called as a class method
3963
if the year is provided.
4064
4165
=head2 method day-of-month
4266
67+
Defined as:
68+
4369
method day-of-month(Date:D:) returns Int:D
4470
71+
Usage:
72+
73+
DATEISH.day-of-month
74+
4575
Returns the day of the month of the date (1..31). Synonymous to the C<day>
4676
method.
4777
4878
=head2 method day-of-week
4979
80+
Defined as:
81+
5082
method day-of-week(Date:D:) returns Int:D
5183
84+
Usage:
85+
86+
DATEISH.day-of-week
87+
5288
Returns the day of the week, where 1 is Monday, 2 is Tuesday and Sunday is 7.
5389
5490
=head2 method day-of-year
5591
92+
Defined as:
93+
5694
method day-of-year(Date:D:) returns Int:D
5795
96+
Usage:
97+
98+
DATEISH.day-of-year
99+
58100
Returns the day of the year (1..366).
59101
60102
=head2 method days-in-month
61103
104+
Defined as:
105+
62106
method days-in-month(year = self.year, month = self.month) returns Int:D
63107
108+
Usage:
109+
110+
DATEISH.days-in-month(YEAR?, MONTH?)
111+
64112
Returns the number of days in a month, where year and month default to that
65113
of the invocant. If both year and month are provided, it can be called as
66114
a class method.
67115
68116
=head2 method week
69117
118+
Defined as:
119+
70120
method week()
71121
122+
Usage:
123+
124+
DATEISH.week
125+
72126
Returns a list of two integers: the year, and the week number. This is because
73127
at the start or end of a year, the week may actually belong to the other year.
74128

0 commit comments

Comments
 (0)