Time::Moment::Adjusters - Adjusters for Time::Moment
$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);
Time::Moment::Adjusters provides adjusters. An adjuster is a CODE reference invoked with an instance of Time::Moment and is expected to return an instance of Time::Moment.
Time::Moment::Adjusters
$adjuster = NextDayOfWeek($day);
The $adjuster adjusts the date to the next occurrence of the given day of the week [1=Monday, 7=Sunday] that is after the date.
$adjuster
$adjuster = NextOrSameDayOfWeek($day);
The $adjuster adjusts the date to the next occurrence of the given day of the week [1=Monday, 7=Sunday]. If the date already falls on the given day of the week it's unaltered.
$adjuster = PreviousDayOfWeek($day);
The $adjuster adjusts the date to the previous occurrence of the given day of the week [1=Monday, 7=Sunday] that is before the date.
$adjuster = PreviousOrSameDayOfWeek($day);
The $adjuster adjusts the date to the previous occurrence of the given day of the week [1=Monday, 7=Sunday]. If the date already falls on the given day of the week it's unaltered.
$adjuster = FirstDayOfWeekInMonth($day);
The $adjuster adjusts the date to the first occurrence of the given day of the week [1=Monday, 7=Sunday] within the month.
$adjuster = LastDayOfWeekInMonth($day);
The $adjuster adjusts the date to the last occurrence of the given day of the week [1=Monday, 7=Sunday] within the month.
$adjuster = NthDayOfWeekInMonth($ordinal, $day);
The $adjuster adjusts the date to the given ordinal day of the week within the month.
Parameters:
The ordinal of the week within the month [-4, -1] ∪ [1, 4].
The day of the week [1=Monday, 7=Sunday].
$adjuster = WesternEasterSunday();
The $adjuster adjusts the date to the Western Easter Sunday, the time of the day is unaltered. The Western computus is based on the Gregorian calendar.
$adjuster = OrthodoxEasterSunday();
The $adjuster adjusts the date to the Orthodox Easter Sunday, the time of the day is unaltered. The Orthodox computus is based on the Julian calendar with the Julian date converted to the equivalent Gregorian date.
$adjuster = NearestMinuteInterval($interval);
The $adjuster adjusts the time of day to the nearest minute of the given minute $interval.
$interval
Given an interval of 15 the outcome would be:
15
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)
None by default. All functions can be exported using the :all tag or individually.
:all
Christian Hansen chansen@cpan.org
chansen@cpan.org
Copyright 2015 by Christian Hansen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Time::Moment, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Time::Moment
CPAN shell
perl -MCPAN -e shell install Time::Moment
For more information on module installation, please visit the detailed CPAN module installation guide.