Skip to content

Commit 9aa6832

Browse files
committed
Undocument .later plurals
1 parent 95647e9 commit 9aa6832

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

doc/Type/Date.pod

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ an object the current day according to the system clock.
2323
say $d.month; # 12
2424
say $d.day; # 24
2525
say $d.day-of-week; # 1 (that's Monday)
26-
say $d.later(days => 20); # 2016-01-13
26+
say $d.later(day => 20); # 2016-01-13
2727
my $n = Date.new('2015-12-31'); # New Year's Eve
2828
say $n - $d; # 7 days between New Years/Christmas Eve
2929
say $n + 1; # 2016-01-01
@@ -81,22 +81,21 @@ Returns a Date object based on the current one, but with a date delta
8181
applied. The date delta can be passed as a named argument where the argument
8282
name is the unit.
8383
84-
Allowed units are C<day>, C<days>, C<week>, C<weeks>, C<month>, C<months>,
85-
C<year>, C<years>.
84+
Allowed units are C<day>, C<week>, C<month>, C<year>.
8685
8786
Please note that the special ":2nd" named parameter syntax can be a compact
8887
and self-documenting way of specifying the delta
8988
90-
say Date.new('2015-12-24').later(:2years);
89+
say Date.new('2015-12-24').later(:2year);
9190
# 2017-12-24
9291
9392
Since addition of several different time units is not commutative, only one
9493
unit may be passed.
9594
9695
my $d = Date.new('2015-02-27');
97-
say $d.later(month => 1).later(:2days); # 2015-03-29
98-
say $d.later(days => 2).later(:1month); # 2015-04-01
99-
say $d.later(days => 2).later(:month); # same, as +True === 1
96+
say $d.later(month => 1).later(:2day); # 2015-03-29
97+
say $d.later(day => 2).later(:1month); # 2015-04-01
98+
say $d.later(day => 2).later(:month); # same, as +True === 1
10099
101100
Negative offsets are allowed, though L<#method earlier> is more idiomatic for
102101
that.

doc/Type/DateTime.pod

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ my $dt = DateTime.new(
2929
);
3030
3131
say $dt; # 2015-11-21T16:01:00Z
32-
say $dt.later(days => 20); # 2015-12-11T16:01:00Z
32+
say $dt.later(day => 20); # 2015-12-11T16:01:00Z
3333
say $dt.truncated-to('hour'); # 2015-11-21T16:00:00Z
3434
say $dt.in-timezone(-8 * 3600); # 2015-11-21T08:01:00-0800
3535
@@ -293,23 +293,22 @@ Returns a DateTime object based on the current one, but with a time delta
293293
applied. The time delta can be passed as a named argument where the argument
294294
name is the unit.
295295
296-
Allowed units are C<second>, C<seconds>, C<minute>, C<minutes>, C<hour>,
297-
C<hours>, C<day>, C<days>, C<week>, C<weeks>, C<month>, C<months>, C<year>,
298-
C<years>.
296+
Allowed units are C<second>, C<minute>, C<hour>, C<day>, C<week>, C<month>,
297+
C<year>.
299298
300299
Please note that the special ":2nd" named parameter syntax can be a compact
301300
and self-documenting way of specifying the delta
302301
303-
say DateTime.new('2015-12-24T12:23:00Z').later(:2years);
302+
say DateTime.new('2015-12-24T12:23:00Z').later(:2year);
304303
# 2017-12-24T12:23:00Z
305304
306305
Since addition of several different time units is not commutative, only one
307306
unit may be passed.
308307
309308
my $d = DateTime.new(date => Date.new('2015-02-27'));
310-
say $d.later(month => 1).later(:2days); # 2015-03-29T00:00:00Z
311-
say $d.later(days => 2).later(:1month); # 2015-04-01T00:00:00Z
312-
say $d.later(days => 2).later(:month); # same, as +True === 1
309+
say $d.later(month => 1).later(:2day); # 2015-03-29T00:00:00Z
310+
say $d.later(day => 2).later(:1month); # 2015-04-01T00:00:00Z
311+
say $d.later(day => 2).later(:month); # same, as +True === 1
313312
314313
Negative offsets are allowed, though L<#method earlier> is more idiomatic for
315314
that.

0 commit comments

Comments
 (0)