Skip to content

Commit e41eda4

Browse files
committed
Revert "Undocument .later plurals"
This reverts commit 9aa6832.
1 parent 9aa6832 commit e41eda4

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

doc/Type/Date.pod

Lines changed: 7 additions & 6 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(day => 20); # 2016-01-13
26+
say $d.later(days => 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,21 +81,22 @@ 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<week>, C<month>, C<year>.
84+
Allowed units are C<day>, C<days>, C<week>, C<weeks>, C<month>, C<months>,
85+
C<year>, C<years>.
8586
8687
Please note that the special ":2nd" named parameter syntax can be a compact
8788
and self-documenting way of specifying the delta
8889
89-
say Date.new('2015-12-24').later(:2year);
90+
say Date.new('2015-12-24').later(:2years);
9091
# 2017-12-24
9192
9293
Since addition of several different time units is not commutative, only one
9394
unit may be passed.
9495
9596
my $d = Date.new('2015-02-27');
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
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
99100
100101
Negative offsets are allowed, though L<#method earlier> is more idiomatic for
101102
that.

doc/Type/DateTime.pod

Lines changed: 8 additions & 7 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(day => 20); # 2015-12-11T16:01:00Z
32+
say $dt.later(days => 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,22 +293,23 @@ 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<minute>, C<hour>, C<day>, C<week>, C<month>,
297-
C<year>.
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>.
298299
299300
Please note that the special ":2nd" named parameter syntax can be a compact
300301
and self-documenting way of specifying the delta
301302
302-
say DateTime.new('2015-12-24T12:23:00Z').later(:2year);
303+
say DateTime.new('2015-12-24T12:23:00Z').later(:2years);
303304
# 2017-12-24T12:23:00Z
304305
305306
Since addition of several different time units is not commutative, only one
306307
unit may be passed.
307308
308309
my $d = DateTime.new(date => Date.new('2015-02-27'));
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
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
312313
313314
Negative offsets are allowed, though L<#method earlier> is more idiomatic for
314315
that.

0 commit comments

Comments
 (0)