@@ -14,61 +14,115 @@ calculating the day of the week.
14
14
15
15
= head2 method year
16
16
17
+ Defined as:
18
+
17
19
method year(Date:D:) returns Int:D
18
20
21
+ Usage:
22
+
23
+ DATEISH.year
24
+
19
25
Returns the year of the date
20
26
21
27
= head2 method month
22
28
29
+ Defined as:
30
+
23
31
method month(Date:D:) returns Int:D
24
32
33
+ Usage:
34
+
35
+ DATEISH.month
36
+
25
37
Returns the month of the date (1..12)
26
38
27
39
= head2 method day
28
40
41
+ Defined as:
42
+
29
43
method day(Date:D:) returns Int:D
30
44
45
+ Usage:
46
+
47
+ DATEISH.day
48
+
31
49
Returns the day of the month of the date (1..31)
32
50
33
51
34
52
= head2 method is-leap-year
35
53
54
+ Defined as:
55
+
36
56
method is-leap-year($year = self.year) returns Bool:D
37
57
58
+ Usage:
59
+
60
+ DATEISH.is-leap-year(YEAR?)
61
+
38
62
Returns C < True > if C < $year > is a leap year. Can be called as a class method
39
63
if the year is provided.
40
64
41
65
= head2 method day-of-month
42
66
67
+ Defined as:
68
+
43
69
method day-of-month(Date:D:) returns Int:D
44
70
71
+ Usage:
72
+
73
+ DATEISH.day-of-month
74
+
45
75
Returns the day of the month of the date (1..31). Synonymous to the C < day >
46
76
method.
47
77
48
78
= head2 method day-of-week
49
79
80
+ Defined as:
81
+
50
82
method day-of-week(Date:D:) returns Int:D
51
83
84
+ Usage:
85
+
86
+ DATEISH.day-of-week
87
+
52
88
Returns the day of the week, where 1 is Monday, 2 is Tuesday and Sunday is 7.
53
89
54
90
= head2 method day-of-year
55
91
92
+ Defined as:
93
+
56
94
method day-of-year(Date:D:) returns Int:D
57
95
96
+ Usage:
97
+
98
+ DATEISH.day-of-year
99
+
58
100
Returns the day of the year (1..366).
59
101
60
102
= head2 method days-in-month
61
103
104
+ Defined as:
105
+
62
106
method days-in-month(year = self.year, month = self.month) returns Int:D
63
107
108
+ Usage:
109
+
110
+ DATEISH.days-in-month(YEAR?, MONTH?)
111
+
64
112
Returns the number of days in a month, where year and month default to that
65
113
of the invocant. If both year and month are provided, it can be called as
66
114
a class method.
67
115
68
116
= head2 method week
69
117
118
+ Defined as:
119
+
70
120
method week()
71
121
122
+ Usage:
123
+
124
+ DATEISH.week
125
+
72
126
Returns a list of two integers: the year, and the week number. This is because
73
127
at the start or end of a year, the week may actually belong to the other year.
74
128
0 commit comments