1Time::Moment::AdjustersU(s3e)r Contributed Perl DocumentaTtiimoen::Moment::Adjusters(3)
2
3
4

NAME

6       Time::Moment::Adjusters - Adjusters for Time::Moment
7

SYNOPSIS

9           $adjuster = NextDayOfWeek($day);
10           $adjuster = NextOrSameDayOfWeek($day);
11
12           $adjuster = PreviousDayOfWeek($day);
13           $adjuster = PreviousOrSameDayOfWeek($day);
14
15           $adjuster = FirstDayOfWeekInMonth($day);
16           $adjuster = LastDayOfWeekInMonth($day);
17
18           $adjuster = NthDayOfWeekInMonth($ordinal, $day);
19
20           $adjuster = WesternEasterSunday();
21           $adjuster = OrthodoxEasterSunday();
22
23           $adjuster = NearestMinuteInterval($interval);
24

DESCRIPTION

26       "Time::Moment::Adjusters" provides adjusters. An adjuster is a CODE
27       reference invoked with an instance of Time::Moment and is expected to
28       return an instance of Time::Moment.
29

FUNCTIONS

31   NextDayOfWeek
32           $adjuster = NextDayOfWeek($day);
33
34       The $adjuster adjusts the date to the next occurrence of the given day
35       of the week [1=Monday, 7=Sunday] that is after the date.
36
37   NextOrSameDayOfWeek
38           $adjuster = NextOrSameDayOfWeek($day);
39
40       The $adjuster adjusts the date to the next occurrence of the given day
41       of the week [1=Monday, 7=Sunday]. If the date already falls on the
42       given day of the week it's unaltered.
43
44   PreviousDayOfWeek
45           $adjuster = PreviousDayOfWeek($day);
46
47       The $adjuster adjusts the date to the previous occurrence of the given
48       day of the week [1=Monday, 7=Sunday] that is before the date.
49
50   PreviousOrSameDayOfWeek
51           $adjuster = PreviousOrSameDayOfWeek($day);
52
53       The $adjuster adjusts the date to the previous occurrence of the given
54       day of the week [1=Monday, 7=Sunday]. If the date already falls on the
55       given day of the week it's unaltered.
56
57   FirstDayOfWeekInMonth
58           $adjuster = FirstDayOfWeekInMonth($day);
59
60       The $adjuster adjusts the date to the first occurrence of the given day
61       of the week [1=Monday, 7=Sunday] within the month.
62
63   LastDayOfWeekInMonth
64           $adjuster = LastDayOfWeekInMonth($day);
65
66       The $adjuster adjusts the date to the last occurrence of the given day
67       of the week [1=Monday, 7=Sunday] within the month.
68
69   NthDayOfWeekInMonth
70           $adjuster = NthDayOfWeekInMonth($ordinal, $day);
71
72       The $adjuster adjusts the date to the given ordinal day of the week
73       within the month.
74
75       Parameters:
76
77       ordinal
78           The ordinal of the week within the month [-4, -1] ∪ [1, 4].
79
80       day The day of the week [1=Monday, 7=Sunday].
81
82   WesternEasterSunday
83           $adjuster = WesternEasterSunday();
84
85       The $adjuster adjusts the date to the Western Easter Sunday. The
86       Western computus is based on the Gregorian calendar.
87
88   OrthodoxEasterSunday
89           $adjuster = OrthodoxEasterSunday();
90
91       The $adjuster adjusts the date to the Orthodox Easter Sunday. The
92       Orthodox computus is based on the Julian calendar with the Julian date
93       converted to the equivalent Gregorian date.
94
95   NearestMinuteInterval
96           $adjuster = NearestMinuteInterval($interval);
97
98       The $adjuster adjusts the time of day to the nearest minute of the
99       given minute interval [1, 1440].
100
101       Given an minute interval of 30:
102
103           T10:14:59 => T10:00:00
104           T10:15:00 => T10:30:00
105           T10:29:59 => T10:30:00
106           T23:55:00 => T00:00:00 (midnight of the following day)
107

EXPORTS

109       None by default. All functions can be exported using the ":all" tag or
110       individually.
111

AUTHOR

113       Christian Hansen "chansen@cpan.org"
114
116       Copyright 2015-2017 by Christian Hansen.
117
118       This is free software; you can redistribute it and/or modify it under
119       the same terms as the Perl 5 programming language system itself.
120
121
122
123perl v5.34.0                      2021-07-23        Time::Moment::Adjusters(3)
Impressum