|
Packit |
95306a |
Add option to Recur: ignore holidays
|
|
Packit |
95306a |
then flags like NBD ignore holidays (but count weekends)
|
|
Packit |
95306a |
When calculating holidays, use this option by default to simplify
|
|
Packit |
95306a |
holidays. Then, order of definitions is not important.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Add options:
|
|
Packit |
95306a |
onlyiso8601, etc. to parse
|
|
Packit |
95306a |
no-delta-secs (not delta as a plain number)
|
|
Packit |
95306a |
no-timezone
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Can I reduce the number of timezone modules loaded when parsing a date
|
|
Packit |
95306a |
with an abbreviation or offset by loading one and testing it before
|
|
Packit |
95306a |
loading a second?
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Make sure the following work:
|
|
Packit |
95306a |
1*12:0:24:0:0:0*FW1 = Christmas Day (observed)
|
|
Packit |
95306a |
December 25 2015 = Christmas Day
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Add a new type of recurrence (???):
|
|
Packit |
95306a |
*Christmas Day*NWD
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Add ability to supply holidays via. a list rather than a config file.
|
|
Packit |
95306a |
ksublondie on perlmonks
|
|
Packit |
95306a |
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
# Deprecated variables:
|
|
Packit |
95306a |
|
|
Packit |
95306a |
03/01/2017 TZ
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Delete Obj.pm line 89 block
|
|
Packit |
95306a |
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
# +1 significant release
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Check performance if changing
|
|
Packit |
95306a |
sub ... {
|
|
Packit |
95306a |
return &sub(...)
|
|
Packit |
95306a |
}
|
|
Packit |
95306a |
to
|
|
Packit |
95306a |
goto &sub(...)
|
|
Packit |
95306a |
|
|
Packit |
95306a |
In Recur.pm, handle encodings in parse
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Add delta.parse_LANG tests
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Add UseTZ
|
|
Packit |
95306a |
= %all use all timezones
|
|
Packit |
95306a |
= %local use local timezone
|
|
Packit |
95306a |
= Z1 Z2 ... use zones Z1, Z2, etc. (one can be %local)
|
|
Packit |
95306a |
Only affects parsing.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Add ways to get timezone in cygwin
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Cache Date::Manip::TZ::zone for ($abbrev,isdst), ($abbrev,$isdst,$offset),
|
|
Packit |
95306a |
other???
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Profile it and look for optimizations.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Date::Manip::Base : get rid of
|
|
Packit |
95306a |
_calc_date_time_strings
|
|
Packit |
95306a |
_delta_convert
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Benchmarks
|
|
Packit |
95306a |
Modules
|
|
Packit |
95306a |
5.x
|
|
Packit |
95306a |
6.00
|
|
Packit |
95306a |
6.00 parse_format
|
|
Packit |
95306a |
DateCalc
|
|
Packit |
95306a |
TimeDate
|
|
Packit |
95306a |
???
|
|
Packit |
95306a |
Tests
|
|
Packit |
95306a |
10,000 dates (parse) time + size
|
|
Packit |
95306a |
10,000 dates (parse + 2 adds + 1 unix date) time + size
|
|
Packit |
95306a |
10,000 scripts (parse 1 date + 2 adds + 1 unix date each) time
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Rewrite Problems.pod (Date Manip is slow)
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Clear out all problems from CPAN
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Methods which require a valid object (secs_since_1970_GMT) should exit
|
|
Packit |
95306a |
instead of trying to perform the operation if the object is invalid.
|
|
Packit |
95306a |
RT #60662 (Matt Blythe)
|
|
Packit |
95306a |
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
# +2 significant release
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Everywhere a timezone can be entered, allow:
|
|
Packit |
95306a |
zone
|
|
Packit |
95306a |
abbrev
|
|
Packit |
95306a |
offset
|
|
Packit |
95306a |
followed by an option:
|
|
Packit |
95306a |
std either STD or DST time, test STD first (default always)
|
|
Packit |
95306a |
dst either STD or DST time, test DST first
|
|
Packit |
95306a |
stdonly only test STD
|
|
Packit |
95306a |
dstonly only test DST
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Change Date::Manip::Base so that $date input can be reference or
|
|
Packit |
95306a |
string.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Clear as much of the backlog of suggestions as possible.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
# TO DO
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Make sure there is a correspondance between:
|
|
Packit |
95306a |
time,localtime,gmtime
|
|
Packit |
95306a |
Date_SecsSince1970,Date_SecsSince1970GMT
|
|
Packit |
95306a |
UnixDate(...,"%s"),UnixDate(...,"%u")
|
|
Packit |
95306a |
and document it all.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Support timezones of the format +500. David Coppit
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Make sure that &DateCalc($date1,"") returns an error. Jim Anderson
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Change the Jan1Week1 variable to accept the values "m1-m7" (1st week contains
|
|
Packit |
95306a |
Jan X) or "d1-d7" (1st week contains the 1st dX day of week ... so d1
|
|
Packit |
95306a |
means that the 1st week of the year contains the 1st Monday).
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Free up the '%u', '%h', and '%X' printf formats. Reserve '%X' for
|
|
Packit |
95306a |
extended formats (%Xa, %Xb, ...).
|
|
Packit |
95306a |
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
# TO CONSIDER
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Special date formats in language file:
|
|
Packit |
95306a |
extra{LABEL} = [ ... ] extra words of type LABEL
|
|
Packit |
95306a |
offset_date =>
|
|
Packit |
95306a |
FORMAT => 'OFFSET'
|
|
Packit |
95306a |
where FORMAT is similar to parse_format
|
|
Packit |
95306a |
%LABEL is a regexp with any of the words
|
|
Packit |
95306a |
OFFSET can include %y, %d, %w, %m, %h, %mn, $s in them
|
|
Packit |
95306a |
same for offset_time, times, and others
|
|
Packit |
95306a |
ex.
|
|
Packit |
95306a |
offset_time => { "%h o'clock" => "%h:00:00" }
|
|
Packit |
95306a |
Support some of the special Russian dates supplied by Yuri Nikulin
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Add a method:
|
|
Packit |
95306a |
($date0,$date1) = $date->week_range();
|
|
Packit |
95306a |
where $date0 and $date1 are the start and end of the week containing
|
|
Packit |
95306a |
$date. Ha Quach
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Add Date_LocaleInit which calls Date_Init and then sets DateFormat
|
|
Packit |
95306a |
config varialbe. Benjamin Low
|
|
Packit |
95306a |
Essentially, I use POSIX::strftime to print a known date in the locale
|
|
Packit |
95306a |
'native' format ('%x'), and parse the result to determine d/m/y, m/d/y,
|
|
Packit |
95306a |
or y/m/d.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Here's what I do for Date::Parse, perhaps for your module you could just
|
|
Packit |
95306a |
substitute a default value for DateFormat:
|
|
Packit |
95306a |
|
|
Packit |
95306a |
sub _dmorder
|
|
Packit |
95306a |
# determine the "natural" day/month order for the current locale
|
|
Packit |
95306a |
# - returns a sub which will expect two arguments (month, day) and
|
|
Packit |
95306a |
# return the arguments swapped as appropriate
|
|
Packit |
95306a |
{
|
|
Packit |
95306a |
# %x - preferred (year, month, day) representation
|
|
Packit |
95306a |
# - some examples: 1999-12-31, 31/12/99, 30.12.1999, 12/31/99
|
|
Packit |
95306a |
my @d = (POSIX::strftime('%x', 0, 0, 0, 31, 12-1, 99) =~
|
|
Packit |
95306a |
/(\d+)\D+(\d+)\D+(\d+)/);
|
|
Packit |
95306a |
|
|
Packit |
95306a |
# check we got one each of "31", "12", and "[19]99" back
|
|
Packit |
95306a |
$@ = "couldn't determine day,month order (got [@d])";
|
|
Packit |
95306a |
warn("$@\n"), return sub { @_ } unless @d == 3;
|
|
Packit |
95306a |
my %d; $d{$1} = $d{$2} = $d{$3} = 1;
|
|
Packit |
95306a |
warn("$@\n"), return sub { @_ }
|
|
Packit |
95306a |
unless ($d{31} and $d{12} and ($d{99} or $d{1999}));
|
|
Packit |
95306a |
|
|
Packit |
95306a |
if ($1 == 31) { $@ = undef; return sub { ($_[1], $_[0]) } }; # d/m/y
|
|
Packit |
95306a |
if ($2 == 31) { $@ = undef; return sub { ($_[0], $_[1]) } }; # m/d/y
|
|
Packit |
95306a |
if ($3 == 31) { $@ = undef; return sub { ($_[0], $_[1]) } }; # y/m/d
|
|
Packit |
95306a |
|
|
Packit |
95306a |
return sub { @_ }; # undetermined, use default
|
|
Packit |
95306a |
}
|
|
Packit |
95306a |
|
|
Packit |
95306a |
*dmorder = _dmorder();
|
|
Packit |
95306a |
|
|
Packit |
95306a |
# and then later in Parse::Date, after month/day regexps (\d+/\d+)...
|
|
Packit |
95306a |
- ($month, $day) = ($1, $2); becomes...
|
|
Packit |
95306a |
+ ($month, $day) = dmorder($1, $2);
|
|
Packit |
95306a |
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Make DateFormat variable handle y/m/d y/d/m m/d/y and d/m/y formats
|
|
Packit |
95306a |
in addition to m/d vs. d/m . Also, make "%D" and "%x" UnixDate formats
|
|
Packit |
95306a |
use this variable. Benjamin Low
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Make the following work for ParseDate Adrian Conte:
|
|
Packit |
95306a |
1 epoch
|
|
Packit |
95306a |
epoch 1
|
|
Packit |
95306a |
-1 epoch
|
|
Packit |
95306a |
epoch -1
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Make work weeks able to start and stop on arbitrary days (even across
|
|
Packit |
95306a |
weekends). Mohammed Saggaf
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Switch to Math::BigInt instead of using "no integer". Vishal Bhatia
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Use autoloader. Ted Ashton
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Better support for fractional seconds. RT 61535
|
|
Packit |
95306a |
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
# GRANULARITY
|
|
Packit |
95306a |
########################################################################
|
|
Packit |
95306a |
|
|
Packit |
95306a |
$flag=&Date_GranularityTest($date,$base,$granularity [,$flags] [$width])
|
|
Packit |
95306a |
$date and $base are dates
|
|
Packit |
95306a |
$granularity and $width are deltas
|
|
Packit |
95306a |
$flags is a list of flags
|
|
Packit |
95306a |
|
|
Packit |
95306a |
To test if a day is one of every other Friday (starting at Friday
|
|
Packit |
95306a |
Feb 7, 1997), go:
|
|
Packit |
95306a |
$base=&ParseDate("Friday Feb 7 1997");
|
|
Packit |
95306a |
$date=&ParseDate("...");
|
|
Packit |
95306a |
$granularity=&ParseDateDelta("+ 2 weeks");
|
|
Packit |
95306a |
$flag=&Date_Granularity($date,$base,$granularity,"exact");
|
|
Packit |
95306a |
If $flag is 1, the $date is a 2nd Friday from Feb 7.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
The most important field in $granularity is the last non-zero element.
|
|
Packit |
95306a |
In the above example, 2 weeks returns the delta 0:0:14:0:0:0 so the
|
|
Packit |
95306a |
last non-zero element is days with a value of 14.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
If $flags is empty, $date is checked to see if it occurs some multiple
|
|
Packit |
95306a |
of 14 days before or after $base. In this case, hourse, minutes, and
|
|
Packit |
95306a |
seconds are completely ignored.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
If $flags contains the words "before" or "after", $date must come
|
|
Packit |
95306a |
before or after $base.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
If $flags contains any other options, or if $width is passed in, the
|
|
Packit |
95306a |
test is treated in an approximate way. A flag of "approx" forces this
|
|
Packit |
95306a |
behavior.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
If $width is not passed in in an approximate comparison, it defaults
|
|
Packit |
95306a |
to 1 in the last non-zero element. Here, the default width is 1 day.
|
|
Packit |
95306a |
If the flag "half" is used, the width (default or passed in) is
|
|
Packit |
95306a |
halved.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
For example if $width is 1 day, add a multiple of $granularity to
|
|
Packit |
95306a |
$base to get as close to $date as possible. If $date is within plus
|
|
Packit |
95306a |
or minus 1 day of this new base, the test is successful. A flag of
|
|
Packit |
95306a |
"plus" or "minus" means that $date must be with plus 1 day or within
|
|
Packit |
95306a |
minus one day of this new base. Flags of "before" or "after" work
|
|
Packit |
95306a |
as well.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
@list=&Date_GranularityList($date,$N,$granularity)
|
|
Packit |
95306a |
Returns a list of $N dates AFTER $date which are created by adding
|
|
Packit |
95306a |
$granularity to $date $N times. If $N<0, it returns $N dates BEFORE
|
|
Packit |
95306a |
$date (the list is in chronological order).
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Make it work in business mode as well which will return only working
|
|
Packit |
95306a |
days. Example, every other friday and it can be told that if friday
|
|
Packit |
95306a |
falls on a holiday to return either thursday or the following monday
|
|
Packit |
95306a |
or leave it out.
|