.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Time::Moment::Adjusters 3pm" .TH Time::Moment::Adjusters 3pm "2016-12-19" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Time::Moment::Adjusters \- Adjusters for Time::Moment .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& $adjuster = NextDayOfWeek($day); \& $adjuster = NextOrSameDayOfWeek($day); \& \& $adjuster = PreviousDayOfWeek($day); \& $adjuster = PreviousOrSameDayOfWeek($day); \& \& $adjuster = FirstDayOfWeekInMonth($day); \& $adjuster = LastDayOfWeekInMonth($day); \& \& $adjuster = NthDayOfWeekInMonth($ordinal, $day); \& \& $adjuster = WesternEasterSunday(); \& $adjuster = OrthodoxEasterSunday(); \& \& $adjuster = NearestMinuteInterval($interval); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Time::Moment::Adjusters\*(C'\fR provides adjusters. An adjuster is a \s-1CODE\s0 reference invoked with an instance of Time::Moment and is expected to return an instance of Time::Moment. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "NextDayOfWeek" .IX Subsection "NextDayOfWeek" .Vb 1 \& $adjuster = NextDayOfWeek($day); .Ve .PP The \f(CW$adjuster\fR adjusts the date to the next occurrence of the given \fIday\fR of the week [1=Monday, 7=Sunday] that is after the date. .SS "NextOrSameDayOfWeek" .IX Subsection "NextOrSameDayOfWeek" .Vb 1 \& $adjuster = NextOrSameDayOfWeek($day); .Ve .PP The \f(CW$adjuster\fR adjusts the date to the next occurrence of the given \fIday\fR of the week [1=Monday, 7=Sunday]. If the date already falls on the given \&\fIday\fR of the week it's unaltered. .SS "PreviousDayOfWeek" .IX Subsection "PreviousDayOfWeek" .Vb 1 \& $adjuster = PreviousDayOfWeek($day); .Ve .PP The \f(CW$adjuster\fR adjusts the date to the previous occurrence of the given \&\fIday\fR of the week [1=Monday, 7=Sunday] that is before the date. .SS "PreviousOrSameDayOfWeek" .IX Subsection "PreviousOrSameDayOfWeek" .Vb 1 \& $adjuster = PreviousOrSameDayOfWeek($day); .Ve .PP The \f(CW$adjuster\fR adjusts the date to the previous occurrence of the given \&\fIday\fR of the week [1=Monday, 7=Sunday]. If the date already falls on the given \fIday\fR of the week it's unaltered. .SS "FirstDayOfWeekInMonth" .IX Subsection "FirstDayOfWeekInMonth" .Vb 1 \& $adjuster = FirstDayOfWeekInMonth($day); .Ve .PP The \f(CW$adjuster\fR adjusts the date to the first occurrence of the given \&\fIday\fR of the week [1=Monday, 7=Sunday] within the month. .SS "LastDayOfWeekInMonth" .IX Subsection "LastDayOfWeekInMonth" .Vb 1 \& $adjuster = LastDayOfWeekInMonth($day); .Ve .PP The \f(CW$adjuster\fR adjusts the date to the last occurrence of the given \&\fIday\fR of the week [1=Monday, 7=Sunday] within the month. .SS "NthDayOfWeekInMonth" .IX Subsection "NthDayOfWeekInMonth" .Vb 1 \& $adjuster = NthDayOfWeekInMonth($ordinal, $day); .Ve .PP The \f(CW$adjuster\fR adjusts the date to the given \fIordinal\fR \fIday\fR of the week within the month. .PP \&\fBParameters:\fR .IP "ordinal" 4 .IX Item "ordinal" The \fIordinal\fR of the week within the month [\-4, \-1] ∪ [1, 4]. .IP "day" 4 .IX Item "day" The \fIday\fR of the week [1=Monday, 7=Sunday]. .SS "WesternEasterSunday" .IX Subsection "WesternEasterSunday" .Vb 1 \& $adjuster = WesternEasterSunday(); .Ve .PP The \f(CW$adjuster\fR adjusts the date to the Western Easter Sunday. The Western computus is based on the Gregorian calendar. .SS "OrthodoxEasterSunday" .IX Subsection "OrthodoxEasterSunday" .Vb 1 \& $adjuster = OrthodoxEasterSunday(); .Ve .PP The \f(CW$adjuster\fR adjusts the date to the Orthodox Easter Sunday. The Orthodox computus is based on the Julian calendar with the Julian date converted to the equivalent Gregorian date. .SS "NearestMinuteInterval" .IX Subsection "NearestMinuteInterval" .Vb 1 \& $adjuster = NearestMinuteInterval($interval); .Ve .PP The \f(CW$adjuster\fR adjusts the time of day to the nearest minute of the given minute \fIinterval\fR [1, 1440]. .PP Given an minute interval of \f(CW30\fR: .PP .Vb 4 \& T10:14:59 => T10:00:00 \& T10:15:00 => T10:30:00 \& T10:29:59 => T10:30:00 \& T23:55:00 => T00:00:00 (midnight of the following day) .Ve .SH "EXPORTS" .IX Header "EXPORTS" None by default. All functions can be exported using the \f(CW\*(C`:all\*(C'\fR tag or individually. .SH "AUTHOR" .IX Header "AUTHOR" Christian Hansen \f(CW\*(C`chansen@cpan.org\*(C'\fR .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2015 by Christian Hansen. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.