Debian Codegraph @

internal/TODO

raw
1 Label regexps and have config variables which define exactly which ones are used
2 OR which ones are not used
3
4 Add option to Recur: ignore holidays
5 then flags like NBD ignore holidays (but count weekends)
6 When calculating holidays, use this option by default to simplify
7 holidays. Then, order of definitions is not important.
8
9 Add options:
10 onlyiso8601, etc. to parse
11 no-delta-secs (not delta as a plain number)
12 no-timezone
13
14 Can I reduce the number of timezone modules loaded when parsing a date
15 with an abbreviation or offset by loading one and testing it before
16 loading a second?
17
18 Make sure the following work:
19 1*12:0:24:0:0:0*FW1 = Christmas Day (observed)
20 December 25 2015 = Christmas Day
21
22 Add a new type of recurrence (???):
23 *Christmas Day*NWD
24
25 Add ability to supply holidays via. a list rather than a config file.
26 ksublondie on perlmonks
27
28 ########################################################################
29 # Deprecated variables:
30
31 03/01/2017 TZ
32
33 Delete Obj.pm line 89 block
34
35 ########################################################################
36 # +1 significant release
37 ########################################################################
38
39 Check performance if changing
40 sub ... {
41 return &sub(...)
42 }
43 to
44 goto &sub(...)
45
46 In Recur.pm, handle encodings in parse
47
48 Add delta.parse_LANG tests
49
50 Add UseTZ
51 = %all use all timezones
52 = %local use local timezone
53 = Z1 Z2 ... use zones Z1, Z2, etc. (one can be %local)
54 Only affects parsing.
55
56 Add ways to get timezone in cygwin
57
58 Cache Date::Manip::TZ::zone for ($abbrev,isdst), ($abbrev,$isdst,$offset),
59 other???
60
61 Profile it and look for optimizations.
62
63 Date::Manip::Base : get rid of
64 _calc_date_time_strings
65 _delta_convert
66
67 Benchmarks
68 Modules
69 5.x
70 6.00
71 6.00 parse_format
72 DateCalc
73 TimeDate
74 ???
75 Tests
76 10,000 dates (parse) time + size
77 10,000 dates (parse + 2 adds + 1 unix date) time + size
78 10,000 scripts (parse 1 date + 2 adds + 1 unix date each) time
79
80 Rewrite Problems.pod (Date Manip is slow)
81
82 Clear out all problems from CPAN
83
84 Methods which require a valid object (secs_since_1970_GMT) should exit
85 instead of trying to perform the operation if the object is invalid.
86 RT #60662 (Matt Blythe)
87
88 ########################################################################
89 # +2 significant release
90 ########################################################################
91
92 Everywhere a timezone can be entered, allow:
93 zone
94 abbrev
95 offset
96 followed by an option:
97 std either STD or DST time, test STD first (default always)
98 dst either STD or DST time, test DST first
99 stdonly only test STD
100 dstonly only test DST
101
102 Change Date::Manip::Base so that $date input can be reference or
103 string.
104
105 Clear as much of the backlog of suggestions as possible.
106
107 ########################################################################
108 # TO DO
109 ########################################################################
110
111 Make sure there is a correspondance between:
112 time,localtime,gmtime
113 Date_SecsSince1970,Date_SecsSince1970GMT
114 UnixDate(...,"%s"),UnixDate(...,"%u")
115 and document it all.
116
117 Support timezones of the format +500. David Coppit
118
119 Make sure that &DateCalc($date1,"") returns an error. Jim Anderson
120
121 Free up the '%u', '%h', and '%X' printf formats. Reserve '%X' for
122 extended formats (%Xa, %Xb, ...).
123
124 ########################################################################
125 # TO CONSIDER
126 ########################################################################
127
128 Special date formats in language file:
129 extra{LABEL} = [ ... ] extra words of type LABEL
130 offset_date =>
131 FORMAT => 'OFFSET'
132 where FORMAT is similar to parse_format
133 %LABEL is a regexp with any of the words
134 OFFSET can include %y, %d, %w, %m, %h, %mn, $s in them
135 same for offset_time, times, and others
136 ex.
137 offset_time => { "%h o'clock" => "%h:00:00" }
138 Support some of the special Russian dates supplied by Yuri Nikulin
139
140 Add a method:
141 ($date0,$date1) = $date->week_range();
142 where $date0 and $date1 are the start and end of the week containing
143 $date. Ha Quach
144
145 Add Date_LocaleInit which calls Date_Init and then sets DateFormat
146 config varialbe. Benjamin Low
147 Essentially, I use POSIX::strftime to print a known date in the locale
148 'native' format ('%x'), and parse the result to determine d/m/y, m/d/y,
149 or y/m/d.
150
151 Here's what I do for Date::Parse, perhaps for your module you could just
152 substitute a default value for DateFormat:
153
154 sub _dmorder
155 # determine the "natural" day/month order for the current locale
156 # - returns a sub which will expect two arguments (month, day) and
157 # return the arguments swapped as appropriate
158 {
159 # %x - preferred (year, month, day) representation
160 # - some examples: 1999-12-31, 31/12/99, 30.12.1999, 12/31/99
161 my @d = (POSIX::strftime('%x', 0, 0, 0, 31, 12-1, 99) =~
162 /(\d+)\D+(\d+)\D+(\d+)/);
163
164 # check we got one each of "31", "12", and "[19]99" back
165 $@ = "couldn't determine day,month order (got [@d])";
166 warn("$@\n"), return sub { @_ } unless @d == 3;
167 my %d; $d{$1} = $d{$2} = $d{$3} = 1;
168 warn("$@\n"), return sub { @_ }
169 unless ($d{31} and $d{12} and ($d{99} or $d{1999}));
170
171 if ($1 == 31) { $@ = undef; return sub { ($_[1], $_[0]) } }; # d/m/y
172 if ($2 == 31) { $@ = undef; return sub { ($_[0], $_[1]) } }; # m/d/y
173 if ($3 == 31) { $@ = undef; return sub { ($_[0], $_[1]) } }; # y/m/d
174
175 return sub { @_ }; # undetermined, use default
176 }
177
178 *dmorder = _dmorder();
179
180 # and then later in Parse::Date, after month/day regexps (\d+/\d+)...
181 - ($month, $day) = ($1, $2); becomes...
182 + ($month, $day) = dmorder($1, $2);
183
184
185 Make DateFormat variable handle y/m/d y/d/m m/d/y and d/m/y formats
186 in addition to m/d vs. d/m . Also, make "%D" and "%x" UnixDate formats
187 use this variable. Benjamin Low
188
189 Make the following work for ParseDate Adrian Conte:
190 1 epoch
191 epoch 1
192 -1 epoch
193 epoch -1
194
195 Make work weeks able to start and stop on arbitrary days (even across
196 weekends). Mohammed Saggaf
197
198 Switch to Math::BigInt instead of using "no integer". Vishal Bhatia
199
200 Use autoloader. Ted Ashton
201
202 Better support for fractional seconds. RT 61535
203
204 ########################################################################
205 # GRANULARITY
206 ########################################################################
207
208 $flag=&Date_GranularityTest($date,$base,$granularity [,$flags] [$width])
209 $date and $base are dates
210 $granularity and $width are deltas
211 $flags is a list of flags
212
213 To test if a day is one of every other Friday (starting at Friday
214 Feb 7, 1997), go:
215 $base=&ParseDate("Friday Feb 7 1997");
216 $date=&ParseDate("...");
217 $granularity=&ParseDateDelta("+ 2 weeks");
218 $flag=&Date_Granularity($date,$base,$granularity,"exact");
219 If $flag is 1, the $date is a 2nd Friday from Feb 7.
220
221 The most important field in $granularity is the last non-zero element.
222 In the above example, 2 weeks returns the delta 0:0:14:0:0:0 so the
223 last non-zero element is days with a value of 14.
224
225 If $flags is empty, $date is checked to see if it occurs some multiple
226 of 14 days before or after $base. In this case, hourse, minutes, and
227 seconds are completely ignored.
228
229 If $flags contains the words "before" or "after", $date must come
230 before or after $base.
231
232 If $flags contains any other options, or if $width is passed in, the
233 test is treated in an approximate way. A flag of "approx" forces this
234 behavior.
235
236 If $width is not passed in in an approximate comparison, it defaults
237 to 1 in the last non-zero element. Here, the default width is 1 day.
238 If the flag "half" is used, the width (default or passed in) is
239 halved.
240
241 For example if $width is 1 day, add a multiple of $granularity to
242 $base to get as close to $date as possible. If $date is within plus
243 or minus 1 day of this new base, the test is successful. A flag of
244 "plus" or "minus" means that $date must be with plus 1 day or within
245 minus one day of this new base. Flags of "before" or "after" work
246 as well.
247
248 @list=&Date_GranularityList($date,$N,$granularity)
249 Returns a list of $N dates AFTER $date which are created by adding
250 $granularity to $date $N times. If $N<0, it returns $N dates BEFORE
251 $date (the list is in chronological order).
252
253 Make it work in business mode as well which will return only working
254 days. Example, every other friday and it can be told that if friday
255 falls on a holiday to return either thursday or the following monday
256 or leave it out.