Changeset 2173
- Timestamp:
- 06/07/08 09:28:19 (6 months ago)
- Files:
-
- psad/trunk/Date-Calc/CHANGES.txt (modified) (2 diffs)
- psad/trunk/Date-Calc/CREDITS.txt (modified) (2 diffs)
- psad/trunk/Date-Calc/Calc.pm (modified) (3 diffs)
- psad/trunk/Date-Calc/Calc.pod (modified) (11 diffs)
- psad/trunk/Date-Calc/Calc.xs (modified) (1 diff)
- psad/trunk/Date-Calc/Calendar.pm (modified) (4 diffs)
- psad/trunk/Date-Calc/Calendar.pod (modified) (4 diffs)
- psad/trunk/Date-Calc/DateCalc.c (modified) (8 diffs)
- psad/trunk/Date-Calc/DateCalc.h (modified) (10 diffs)
- psad/trunk/Date-Calc/EXAMPLES.txt (modified) (1 diff)
- psad/trunk/Date-Calc/INSTALL.txt (modified) (8 diffs)
- psad/trunk/Date-Calc/MANIFEST (modified) (2 diffs)
- psad/trunk/Date-Calc/Makefile.PL (modified) (2 diffs)
- psad/trunk/Date-Calc/README.txt (modified) (6 diffs)
- psad/trunk/Date-Calc/TOOLS.txt (modified) (1 diff)
- psad/trunk/Date-Calc/ToolBox.h (modified) (5 diffs)
- psad/trunk/Date-Calc/VERSION (modified) (1 diff)
- psad/trunk/Date-Calc/lib/Date/Calc/Object.pm (modified) (3 diffs)
- psad/trunk/Date-Calc/lib/Date/Calendar/Profiles.pm (modified) (13 diffs)
- psad/trunk/Date-Calc/lib/Date/Calendar/Profiles.pod (modified) (2 diffs)
- psad/trunk/Date-Calc/lib/Date/Calendar/Year.pm (modified) (6 diffs)
- psad/trunk/Date-Calc/lib/Date/Calendar/Year.pod (modified) (5 diffs)
- psad/trunk/Date-Calc/t/f000.t (modified) (9 diffs)
- psad/trunk/Date-Calc/t/f001.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f002.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f003.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f004.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f005.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f006.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f007.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f008.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f009.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f010.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f011.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f012.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f013.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f014.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f015.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f016.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f017.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f018.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f019.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f020.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f021.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f022.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f023.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f024.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f025.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f026.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f027.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f028.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f029.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f030.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f031.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f032.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f033.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f034.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f035.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/f036.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/m001.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/m002.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/m003.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/m004.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/m005.t (modified) (11 diffs)
- psad/trunk/Date-Calc/t/m006.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/m007.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/m008.t (modified) (3 diffs)
- psad/trunk/Date-Calc/t/m009.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/m010.t (modified) (1 diff)
- psad/trunk/Date-Calc/t/m011.t (modified) (1 diff)
- psad/trunk/Date-Calc/tools/compile.bat (modified) (1 diff)
- psad/trunk/Date-Calc/tools/compile.pl (modified) (1 diff)
- psad/trunk/Date-Calc/tools/compile.sh (modified) (1 diff)
- psad/trunk/Date-Calc/tools/iso2pc.c (modified) (1 diff)
- psad/trunk/Date-Calc/tools/pc2iso.c (modified) (1 diff)
- psad/trunk/Date-Calc/typemap (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
psad/trunk/Date-Calc/CHANGES.txt
r737 r2173 1 1 ==================================== 2 Package "Date::Calc" Version 5. 32 Package "Date::Calc" Version 5.4 3 3 ==================================== 4 4 5 5 6 Copyright (c) 1995 - 200 2by Steffen Beyer.6 Copyright (c) 1995 - 2004 by Steffen Beyer. 7 7 All rights reserved. 8 8 … … 10 10 Version history: 11 11 ---------------- 12 13 Version 5.4 03.10.2004 14 15 + Added compiler directives for C++. 16 + Removed "Carp::Clan" from the distribution (available separately). 17 + Fixed bug in initialization of "Date::Calendar::Year" objects. 18 + Added method "tags()" to "Date::Calendar" and "Date::Calendar::Year". 19 + Fixed the formula for "Labor Day" in the U.S. to "1/Mon/Sep". 20 + Added a new recipe to the "Date::Calc" documentation. 21 + Added Romanian to the list of languages supported by "Date::Calc". 22 + Changed the example script "calendar.cgi" to highlight the name 23 which led to a given date being a holiday. 24 + Fixed the Polish entries in "Date::Calc". 25 + Added a few commemorative days to the Norwegian calendar profile. 26 + Added "use bytes" to all Perl files to avoid problems on systems 27 not using the standard locale "C". 28 + Fixed test 5 of t/m005.t to (hopefully) work under other locales. 12 29 13 30 Version 5.3 29.09.2002 psad/trunk/Date-Calc/CREDITS.txt
r737 r2173 1 1 ==================================== 2 Package "Date::Calc" Version 5. 32 Package "Date::Calc" Version 5.4 3 3 ==================================== 4 4 5 5 6 Copyright (c) 1995 - 200 2by Steffen Beyer.6 Copyright (c) 1995 - 2004 by Steffen Beyer. 7 7 All rights reserved. 8 8 … … 365 365 The bug hasn't been fixed yet, but there is a workaround which seems 366 366 to remedy the problem: First add one workday to the date in question, 367 and then subtract one workday more than you initially intended. 368 369 367 and then subtract one workday more than initially. 368 369 Many thanks to Mike Swieton <swietonm@student.gvsu.edu> (and many other 370 people in the past) for sending in a patch so that ToolBox.h will compile 371 with C++ compilers. 372 373 Thanks to Joe Rice <riceja@water-melon.net> and Sridhar Gopal 374 <sridhar.gopal@bankofamerica.com> for pointing out that the formula 375 for Labor Day in the U.S. apparently was wrong; it returned 376 September 8th in 2003 but Labor Day in that year actually was on 377 September 1st. It should obviously be "1/Mon/Sep" instead. 378 379 Many thanks to M.S. Tawfik <mstawfik@optonline.net> for finding a 380 bug in the "init()" method of Date::Calendar::Year when the year 381 starts with a Sunday (such as in 1995) and for sending a patch! 382 383 Thanks to George Cooke <quatto@hotmail.com> for raising the question 384 of how to "normalize" the results of the "Delta_YMD()" function to 385 show only positive values, the answer to which has been included as 386 a "recipe" in the documentation of Date::Calc. 387 388 Thanks to Joachim Ansorg <joachim@ansorgs.de> for sending me the 389 necessary information to add Romanian to the list of languages 390 supported by Date::Calc. 391 392 Many thanks to Peter Prymmer <PPrymmer@factset.com> for suggesting 393 a work-around for the problems that can arise when a locale other 394 than "C" is used! 395 396 Thanks to Olle E. Johansson <oej@edvina.net> for sending corrections 397 for the Swedish calendar profile. 398 399 Thanks to Harold van Oostrom <perl@lanceerplaats.nl> for sending in a 400 fix for the Polish language in Date::Calc. Also many thanks for his patch 401 to make Date::Calc ready for UTF-8, which unfortunately I haven't had 402 the time yet to evaluate. 403 404 Many thanks also to Sven Geisler <sgeisler@aeccom.com> for sending me 405 corrections for the profile and official references for ALL federal 406 states of Australia. 407 408 Many thanks to Tony Mountifield <tony@mountifield.org> for sending 409 in a patch to enable Date::Calc to handle negative values of time_t, 410 for dates before the Epoch. I decided not to include it at this time 411 first because the system functions such as localtime, gmtime and 412 mktime are considered legacy functions due to their rather restricted 413 range (Date::Calc's own functions operate on a much broader range), 414 and second because it cost so much effort to make these functions 415 work in Date::Calc under Unix and Windows as well as under MacOS 416 (Classic), that the risk of breaking things is just too high, not 417 to mention the time and effort needed to get it right again, which 418 I can't spend at the moment, unfortunately. So please use Date::Calc's 419 own functions instead, which cover the intended range of dates anyway. 420 421 Thanks a lot to Can Bican <can@ripe.net>, Ziya Suzen <ziya@ripe.net>, 422 Henk Uijterwaal <henk@ripe.net> and the Amsterdam Perl Mongers for 423 providing me with more detailed information concerning the 424 "Bevrijdingsdag" (5th of May) in the Netherlands. 425 426 Many thanks to Vetle Roeim <vetler@opera.com> for sending some more 427 commemorative days (some companies give half a day off) for the 428 Norwegian profile. 429 430 psad/trunk/Date-Calc/Calc.pm
r737 r2173 2 2 ############################################################################### 3 3 ## ## 4 ## Copyright (c) 1995 - 200 2by Steffen Beyer. ##4 ## Copyright (c) 1995 - 2004 by Steffen Beyer. ## 5 5 ## All rights reserved. ## 6 6 ## ## … … 12 12 package Date::Calc; 13 13 14 BEGIN { eval { require bytes; }; } 14 15 use strict; 15 16 use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION); … … 99 100 ################################################## 100 101 101 $VERSION = '5. 3';102 $VERSION = '5.4'; 102 103 103 104 bootstrap Date::Calc $VERSION; psad/trunk/Date-Calc/Calc.pod
r737 r2173 588 588 "C<Day_of_Year($year,12,31)>" returns either "C<365>" or "C<366>". 589 589 590 The day of year is sometimes also referred to as the Julian day (or date), 591 although it has nothing to do with the Julian calendar, the calendar which 592 was used before the Gregorian calendar. 593 594 In order to convert the number returned by this function back into a 595 date, use the function "C<Add_Delta_Days()>" (described further below), 596 as follows: 597 598 $doy = Day_of_Year($year,$month,$day); 599 ($year,$month,$day) = Add_Delta_Days($year,1,1, $doy - 1); 600 590 601 =item * 591 602 … … 601 612 This is sometimes also referred to (not quite correctly) as the Julian 602 613 date (or day). This may cause confusion, because also the number of the 603 day in a year (from 1 to 365 or 366) is frequently called the "Julian date". 604 605 In fact the calendar that was used B<BEFORE> the Gregorian calendar 606 was the Julian calendar - named after famous Julius Caesar, who had 607 instituted it in Roman times. The Julian calendar was less precise 608 because it had too many leap years compared to the true mean length 609 of a year, and because rulers often changed it arbitrarily, in order 610 to lengthen their own reign, for instance. 614 day in a year (from 1 to 365 or 366) is frequently called the "Julian day". 615 616 More confusing still, this has nothing to do with the Julian calendar, 617 which was used B<BEFORE> the Gregorian calendar. 618 619 The Julian calendar was named after famous Julius Caesar, who had 620 instituted it in Roman times. The Julian calendar is less precise than 621 the Gregorian calendar because it has too many leap years compared to 622 the true mean length of a year (but the Gregorian calendar also still 623 has one day too much every 5000 years). Anyway, the Julian calendar was 624 better than what existed before, because rulers had often changed the 625 calendar used until then in arbitrary ways, in order to lengthen their 626 own reign, for instance. 611 627 612 628 In order to convert the number returned by this function back into … … 1469 1485 LANGUAGE ITSELF>), or any uniquely identifying abbreviation of the name 1470 1486 of a language (i.e., the first few letters), and returns its corresponding 1471 internal number (1..1 3in the original distribution) upon a successful match,1487 internal number (1..14 in the original distribution) upon a successful match, 1472 1488 or "C<0>" otherwise (therefore, the return value can also be used as the 1473 1489 conditional expression in an "if" statement). … … 1494 1510 suomi (Finnish) ==> 11 1495 1511 Magyar (Hungarian) ==> 12 1496 Polski (Polish) ==> 13 1512 polski (Polish) ==> 13 1513 Romaneste (Romanian) ==> 14 1497 1514 1498 1515 See the section "How to install additional languages" in the file … … 1861 1878 12 Hungarian : "dd. Mmmmmm yyyy., wwwwww" 1862 1879 13 Polish : "Wwwwww, dd Mmmmmm yyyy" 1880 14 Romanian : "Wwwwww dd Mmmmmm yyyy" 1863 1881 1864 1882 (You can change these formats in the file "DateCalc.c" before … … 1986 2004 11 ==> suomi (Finnish) 1987 2005 12 ==> Magyar (Hungarian) 1988 13 ==> Polski (Polish) 2006 13 ==> polski (Polish) 2007 14 ==> Romaneste (Romanian) 1989 2008 1990 2009 See the section "How to install additional languages" in the file … … 2027 2046 11 ==> suomi (Finnish) 2028 2047 12 ==> Magyar (Hungarian) 2029 13 ==> Polski (Polish) 2048 13 ==> polski (Polish) 2049 14 ==> Romaneste (Romanian) 2030 2050 2031 2051 See the section "How to install additional languages" in the file … … 2084 2104 2085 2105 In the original distribution of this package there are thirteen built-in 2086 languages, therefore the value returned by this function will be "C<1 3>"2106 languages, therefore the value returned by this function will be "C<14>" 2087 2107 if no other languages have been added to your particular installation. 2088 2108 … … 2812 2832 See L<Date::Calendar(3)> for how to do that. 2813 2833 2834 =item 17) 2835 2836 How can I "normalize" the output of the "Delta_YMDHMS()" (or "Delta_YMD()") 2837 function so that it contains only positive values? 2838 2839 I.e., how can I show a difference in date (and time) in a more human-readable 2840 form, for example in order to show how much time until (or since) the expiration 2841 of something (e.g. an account, a domain, a credit card, etc.) is left (has passed)? 2842 2843 a) Delta_YMDHMS(): 2844 2845 #!perl 2846 use strict; 2847 use Date::Calc qw(Today_and_Now Delta_YMDHMS Add_Delta_YMDHMS Delta_DHMS Date_to_Text); 2848 2849 my $today = [Today_and_Now()]; 2850 my $target = [2005,1,1,0,0,0]; 2851 2852 my $sign = "until"; 2853 my $delta = Normalize_Delta_YMDHMS($today,$target); 2854 if ($delta->[0] < 0) 2855 { 2856 $sign = "since"; 2857 $delta = Normalize_Delta_YMDHMS($target,$today); 2858 } 2859 printf("Today is %s %02d:%02d:%02d\n", Date_to_Text(@{$today}[0..2]), @{$today}[3..5]); 2860 printf 2861 ( 2862 "%d year%s, %d month%s, %d day%s, %d hour%s, %d minute%s, %d second%s %s %s %02d:%02d:%02d\n", 2863 $delta->[0], (($delta->[0]==1)?'':'s'), 2864 $delta->[1], (($delta->[1]==1)?'':'s'), 2865 $delta->[2], (($delta->[2]==1)?'':'s'), 2866 $delta->[3], (($delta->[3]==1)?'':'s'), 2867 $delta->[4], (($delta->[4]==1)?'':'s'), 2868 $delta->[5], (($delta->[5]==1)?'':'s'), 2869 $sign, 2870 Date_to_Text(@{$target}[0..2]), 2871 @{$target}[3..5] 2872 ); 2873 2874 sub Normalize_Delta_YMDHMS 2875 { 2876 my($date1,$date2) = @_; 2877 my(@delta); 2878 2879 @delta = Delta_YMDHMS(@$date1,@$date2); 2880 while ($delta[1] < 0 or 2881 $delta[2] < 0 or 2882 $delta[3] < 0 or 2883 $delta[4] < 0 or 2884 $delta[5] < 0) 2885 { 2886 if ($delta[1] < 0) { $delta[0]--; $delta[1] += 12; } 2887 if ($delta[2] < 0) 2888 { 2889 $delta[1]--; 2890 @delta[2..5] = (0,0,0,0); 2891 @delta[2..5] = Delta_DHMS(Add_Delta_YMDHMS(@$date1,@delta),@$date2); 2892 } 2893 if ($delta[3] < 0) { $delta[2]--; $delta[3] += 24; } 2894 if ($delta[4] < 0) { $delta[3]--; $delta[4] += 60; } 2895 if ($delta[5] < 0) { $delta[4]--; $delta[5] += 60; } 2896 } 2897 return \@delta; 2898 } 2899 2900 b) Delta_YMD(): 2901 2902 #!perl 2903 use strict; 2904 use Date::Calc qw(Today Delta_YMD Add_Delta_YM Delta_Days Date_to_Text); 2905 2906 my($sign,$delta); 2907 my $today = [Today()]; 2908 my $target = [2005,1,1]; 2909 2910 if (Delta_Days(@$today,@$target) < 0) 2911 { 2912 $sign = "since"; 2913 $delta = Normalize_Delta_YMD($target,$today); 2914 } 2915 else 2916 { 2917 $sign = "until"; 2918 $delta = Normalize_Delta_YMD($today,$target); 2919 } 2920 print "Today is ", Date_to_Text(@$today), "\n"; 2921 printf 2922 ( 2923 "%d year%s, %d month%s, %d day%s %s %s\n", 2924 $delta->[0], (($delta->[0]==1)?'':'s'), 2925 $delta->[1], (($delta->[1]==1)?'':'s'), 2926 $delta->[2], (($delta->[2]==1)?'':'s'), 2927 $sign, 2928 Date_to_Text(@$target) 2929 ); 2930 2931 sub Normalize_Delta_YMD 2932 { 2933 my($date1,$date2) = @_; 2934 my(@delta); 2935 2936 @delta = Delta_YMD(@$date1,@$date2); 2937 while ($delta[1] < 0 or $delta[2] < 0) 2938 { 2939 if ($delta[1] < 0) { $delta[0]--; $delta[1] += 12; } 2940 if ($delta[2] < 0) 2941 { 2942 $delta[1]--; 2943 $delta[2] = Delta_Days(Add_Delta_YM(@$date1,@delta[0,1]),@$date2); 2944 } 2945 } 2946 return \@delta; 2947 } 2948 2949 Note that for normalizing just a time vector, you can use the built-in 2950 function "Normalize_DHMS()". However, this will yield either all positive 2951 B<OR> all negative values, B<NOT> all positive values as above. 2952 2814 2953 =back 2815 2954 … … 2834 2973 =head1 VERSION 2835 2974 2836 This man page documents "Date::Calc" version 5. 3.2975 This man page documents "Date::Calc" version 5.4. 2837 2976 2838 2977 =head1 AUTHOR … … 2844 2983 =head1 COPYRIGHT 2845 2984 2846 Copyright (c) 1995 - 200 2by Steffen Beyer. All rights reserved.2985 Copyright (c) 1995 - 2004 by Steffen Beyer. All rights reserved. 2847 2986 2848 2987 =head1 LICENSE psad/trunk/Date-Calc/Calc.xs
r737 r2173 3 3 /*****************************************************************************/ 4 4 /* */ 5 /* Copyright (c) 1995 - 200 2by Steffen Beyer. */5 /* Copyright (c) 1995 - 2004 by Steffen Beyer. */ 6 6 /* All rights reserved. */ 7 7 /* */ psad/trunk/Date-Calc/Calendar.pm
r737 r2173 2 2 ############################################################################### 3 3 ## ## 4 ## Copyright (c) 2000 - 200 2by Steffen Beyer. ##4 ## Copyright (c) 2000 - 2004 by Steffen Beyer. ## 5 5 ## All rights reserved. ## 6 6 ## ## … … 12 12 package Date::Calendar; 13 13 14 BEGIN { eval { require bytes; }; } 14 15 use strict; 15 16 use vars qw( @ISA @EXPORT @EXPORT_OK $VERSION ); … … 23 24 @EXPORT_OK = qw(); 24 25 25 $VERSION = '5. 3';26 $VERSION = '5.4'; 26 27 27 28 use Carp::Clan qw(^Date::); … … 157 158 } 158 159 160 sub tags 161 { 162 my($self) = shift; 163 my(%result) = (); 164 my(@date); 165 166 if (@_) 167 { 168 @date = shift_date(\@_); 169 return $self->year($date[0])->tags(@date); 170 } 171 else { return \%result; } 172 } 173 159 174 sub delta_workdays 160 175 { psad/trunk/Date-Calc/Calendar.pod
r737 r2173 51 51 @dates = $calendar->search(PATTERN); 52 52 $dates = $calendar->search(PATTERN); 53 54 $hashref = $calendar->tags(YEAR,MONTH,DAY|DATE); 53 55 54 56 $days = $calendar->delta_workdays(YEAR1,MONTH1,DAY1|DATE1 … … 293 295 In scalar context, only the number of items in the resulting list 294 296 is returned, instead of the resulting list itself (as in list context). 297 298 =item * 299 300 C<$hashref = $calendar-E<gt>tags(YEAR,MONTH,DAY|DATE);> 301 302 This method returns a hash reference for the given calendar and 303 date. The hash it refers to is a copy of the calendar profile's 304 internal hash which contains the names for the given date as keys 305 and 0, 1, 2, or 3 as their corresponding values meaning the following: 306 307 0 => commemorative day 308 1 => "half" holiday 309 2 => "full" holiday 310 3 => both a "half" and a "full" holiday 311 312 The value "3" should only occur if a date has been redefined by the 313 underlying profile using the same key (i.e., the same name) but with 314 a different type of holiday. 295 315 296 316 =item * … … 514 534 Date::Calc::Object(3), Date::Calc(3), Bit::Vector(3). 515 535 536 =head1 KNOWN BUGS 537 538 The method "add_delta_workdays()" is known to produce results 539 which are sometimes off by one working day when a negative 540 offset is used. As a workaround, try to add one working day 541 first and then subtract one working day more than initially 542 intended. See also the file "examples/bug.pl" for how to do 543 this. 544 516 545 =head1 VERSION 517 546 518 This man page documents "Date::Calendar" version 5. 3.547 This man page documents "Date::Calendar" version 5.4. 519 548 520 549 =head1 AUTHOR … … 526 555 =head1 COPYRIGHT 527 556 528 Copyright (c) 2000 - 200 2by Steffen Beyer. All rights reserved.557 Copyright (c) 2000 - 2004 by Steffen Beyer. All rights reserved. 529 558 530 559 =head1 LICENSE psad/trunk/Date-Calc/DateCalc.c
r737 r2173 404 404 }; 405 405 406 #define DateCalc_LANGUAGES 1 3407 408 Z_int DateCalc_Language = 1; /* Default = 1 (English) */406 #define DateCalc_LANGUAGES 14 407 408 Z_int DateCalc_Language = 1; /* Default = 1 (English) */ 409 409 410 410 const N_char DateCalc_Month_to_Text_[DateCalc_LANGUAGES+1][13][32] = … … 464 464 }, 465 465 { 466 "???", "Styczen", "Luty", "Marzec", "Kwiecien", "Maj", "Czerwiec", 467 "Lipiec", "Sierpien", "Wrzesien", "Pazdziernik", "Listopad", "Grudzien" 466 "???", "stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", 467 "lipca", "sierpnia", "wrzesnia", "pazdziernika", "listopada", "grudnia" 468 /* "???", "Styczen", "Luty", "Marzec", "Kwiecien", "Maj", "Czerwiec", */ /* non-flected? */ 469 /* "Lipiec", "Sierpien", "Wrzesien", "Pazdziernik", "Listopad", "Grudzien" */ 468 470 /* "???", "Styczeñ", "Luty", "Marzec", "Kwiecieñ", "Maj", "Czerwiec", */ /* ISO-Latin-2 */ 469 471 /* "Lipiec", "Sierpieñ", "Wrzesieñ", "PaŒdziernik", "Listopad", "Grudzieñ" */ 472 }, 473 { 474 "???", "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", 475 "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" 470 476 } 471 477 }; … … 526 532 }, 527 533 { 528 "???", "Poniedzialek", "Wtorek", "Sroda", 529 "Czwartek", "Piatek", "Sobota", "Niedziela" 534 "???", "poniedzialek", "wtorek", "srodek", 535 "czwartek", "piatek", "sobota", "niedziele" 536 /* "???", "Poniedzialek", "Wtorek", "Sroda", */ /* non-flected? */ 537 /* "Czwartek", "Piatek", "Sobota", "Niedziela" */ 530 538 /* "???", "Poniedzia³ek", "Wtorek", "Šroda", */ /* ISO-Latin-2 */ 531 539 /* "Czwartek", "Pi±tek", "Sobota", "Niedziela" */ 540 }, 541 { 542 "???", "Luni", "Marti", "Miercuri", 543 "Joi", "Vineri", "Sambata", "Duminica" 532 544 } 533 545 }; … … 580 592 "???", "Pn", "Wt", "Sr", "Cz", "Pt", "So", "Ni" /* 13 */ 581 593 /* "???", "Pn", "Wt", "Šr", "Cz", "Pt", "So", "Ni" */ /* 13 */ /* ISO-Latin-2 */ 594 }, 595 { 596 "", "", "", "", "", "", "", "" /* 14 */ 582 597 } 583 598 }; … … 606 621 "%s, %d. %sta %d", /* 11 suomi */ 607 622 "%d. %s %d., %s", /* 12 Magyar */ 608 "%s, %d %s %d" /* 13 Polski */ 623 "%s, %d %s %d", /* 13 polski */ 624 "%s %d %s %d" /* 14 Romaneste */ 609 625 }; 610 626 … … 613 629 "???", "English", "Français", "Deutsch", "Español", 614 630 "Português", "Nederlands", "Italiano", "Norsk", "Svenska", 615 "Dansk", "suomi", "Magyar", " Polski"631 "Dansk", "suomi", "Magyar", "polski", "Romaneste" 616 632 }; 617 633 … … 2220 2236 charptr DateCalc_Version(void) 2221 2237 { 2222 return( (charptr) "5. 3" );2223 } 2224 2225 /*****************************************************************************/ 2226 /* VERSION: 5. 3*/2238 return( (charptr) "5.4" ); 2239 } 2240 2241 /*****************************************************************************/ 2242 /* VERSION: 5.4 */ 2227 2243 /*****************************************************************************/ 2228 2244 /* VERSION HISTORY: */ 2229 2245 /*****************************************************************************/ 2230 2246 /* */ 2231 /* Version 5.3 29.09.02 No changes. */ 2232 /* Version 5.2 18.09.02 No changes. */ 2233 /* Version 5.1 08.09.02 Added conditional changes for MacOS/MacPerl. */ 2234 /* Version 5.0 10.10.01 New YMD/HMS functions, replaced <ctype.h>, ... */ 2235 /* Version 4.3 08.01.00 decode_date_??: (yy < 70 ? 20yy : 19yy) */ 2236 /* Version 4.2 07.09.98 No changes. */ 2237 /* Version 4.1 08.06.98 Fixed bug in "add_delta_ymd()". */ 2238 /* Version 4.0 12.05.98 Major rework. Added multi-language support. */ 2239 /* Version 3.2 15.06.97 Added "week_of_year()". */ 2240 /* Version 3.1 12.06.97 No significant changes. */ 2241 /* Version 3.0 16.02.97 Changed conventions for unsuccessful returns. */ 2242 /* Version 2.3 22.11.96 Fixed unbalanced "malloc" and "free". */ 2243 /* Version 2.2 26.05.96 No significant changes. */ 2244 /* Version 2.1 26.05.96 Fixed HH MM SS parameter checks. */ 2245 /* Version 2.0 25.05.96 Added time calculations. Major rework. */ 2246 /* Version 1.6 20.04.96 Not published. */ 2247 /* Version 1.5 14.03.96 No significant changes. */ 2248 /* Version 1.4 11.02.96 No significant changes. */ 2249 /* Version 1.3 10.12.95 Added "days_in_month()". */ 2250 /* Version 1.2b 27.11.95 No significant changes. */ 2251 /* Version 1.2a 21.11.95 Fix for type name clashes. */ 2252 /* Version 1.1 18.11.95 Fix for type name clashes. */ 2253 /* Version 1.01 16.11.95 Improved compliance w/ programming standards. */ 2254 /* Version 1.0 14.11.95 First version under UNIX (with Perl module). */ 2255 /* Version 0.9 01.11.93 First version of C library under MS-DOS. */ 2247 /* Version 5.4 03.10.04 Added compiler directives for C++. */ 2248 /* Version 5.3 29.09.02 No changes. */ 2249 /* Version 5.2 18.09.02 No changes. */ 2250 /* Version 5.1 08.09.02 Added conditional changes for MacOS/MacPerl. */ 2251 /* Version 5.0 10.10.01 New YMD/HMS functions, replaced <ctype.h>, ... */ 2252 /* Version 4.3 08.01.00 decode_date_??: (yy < 70 ? 20yy : 19yy) */ 2253 /* Version 4.2 07.09.98 No changes. */ 2254 /* Version 4.1 08.06.98 Fixed bug in "add_delta_ymd()". */ 2255 /* Version 4.0 12.05.98 Major rework. Added multi-language support. */ 2256 /* Version 3.2 15.06.97 Added "week_of_year()". */ 2257 /* Version 3.1 12.06.97 No significant changes. */ 2258 /* Version 3.0 16.02.97 Changed conventions for unsuccessful returns. */ 2259 /* Version 2.3 22.11.96 Fixed unbalanced "malloc" and "free". */ 2260 /* Version 2.2 26.05.96 No significant changes. */ 2261 /* Version 2.1 26.05.96 Fixed HH MM SS parameter checks. */ 2262 /* Version 2.0 25.05.96 Added time calculations. Major rework. */ 2263 /* Version 1.6 20.04.96 Not published. */ 2264 /* Version 1.5 14.03.96 No significant changes. */ 2265 /* Version 1.4 11.02.96 No significant changes. */ 2266 /* Version 1.3 10.12.95 Added "days_in_month()". */ 2267 /* Version 1.2b 27.11.95 No significant changes. */ 2268 /* Version 1.2a 21.11.95 Fix for type name clashes. */ 2269 /* Version 1.1 18.11.95 Fix for type name clashes. */ 2270 /* Version 1.01 16.11.95 Improved compliance w/ programming standards. */ 2271 /* Version 1.0 14.11.95 First version under UNIX (with Perl module). */ 2272 /* Version 0.9 01.11.93 First version of C library under MS-DOS. */ 2256 2273 /* */ 2257 2274 /*****************************************************************************/ … … 2267 2284 /*****************************************************************************/ 2268 2285 /* */ 2269 /* Copyright (c) 1993 - 200 2by Steffen Beyer. */2286 /* Copyright (c) 1993 - 2004 by Steffen Beyer. */ 2270 2287 /* All rights reserved. */ 2271 2288 /* */ psad/trunk/Date-Calc/DateCalc.h
r737 r2173 1 1 #ifndef MODULE_DATE_CALC 2 2 #define MODULE_DATE_CALC 3 #ifdef __cplusplus 4 extern "C" 5 { 6 #endif 3 7 /*****************************************************************************/ 4 8 /* MODULE NAME: DateCalc.h MODULE TYPE: (lib) */ … … 408 412 */ 409 413 410 #define DateCalc_LANGUAGES 1 3411 412 extern Z_int DateCalc_Language; /* Default = 1 (English) */414 #define DateCalc_LANGUAGES 14 415 416 extern Z_int DateCalc_Language; /* Default = 1 (English) */ 413 417 414 418 extern const N_char DateCalc_Month_to_Text_[DateCalc_LANGUAGES+1][13][32]; … … 469 473 }, 470 474 { 471 "???", "Styczen", "Luty", "Marzec", "Kwiecien", "Maj", "Czerwiec", 472 "Lipiec", "Sierpien", "Wrzesien", "Pazdziernik", "Listopad", "Grudzien" 475 "???", "stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", 476 "lipca", "sierpnia", "wrzesnia", "pazdziernika", "listopada", "grudnia" 477 }, 478 { 479 "???", "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", 480 "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" 473 481 } 474 482 }; … … 531 539 }, 532 540 { 533 "???", "Poniedzialek", "Wtorek", "Sroda", 534 "Czwartek", "Piatek", "Sobota", "Niedziela" 541 "???", "poniedzialek", "wtorek", "srodek", 542 "czwartek", "piatek", "sobota", "niedziele" 543 }, 544 { 545 "???", "Luni", "Marti", "Miercuri", 546 "Joi", "Vineri", "Sambata", "Duminica" 535 547 } 536 548 }; … … 584 596 { 585 597 "???", "Pn", "Wt", "Sr", "Cz", "Pt", "So", "Ni" 598 }, 599 { 600 "", "", "", "", "", "", "", "" 586 601 } 587 602 }; … … 614 629 "%s, %d. %sta %d", 615 630 "%d. %s %d., %s", 616 "%s, %d %s %d" 631 "%s, %d %s %d", 632 "%s %d %s %d" 617 633 }; 618 634 */ … … 623 639 "???", "English", "Français", "Deutsch", "Español", 624 640 "Português", "Nederlands", "Italiano", "Norsk", "Svenska", 625 "Dansk", "suomi", "Magyar", " Polski"641 "Dansk", "suomi", "Magyar", "polski", "Romaneste" 626 642 }; 627 643 */ … … 632 648 633 649 /*****************************************************************************/ 634 /* VERSION: 5. 3*/650 /* VERSION: 5.4 */ 635 651 /*****************************************************************************/ 636 652 /* VERSION HISTORY: */ 637 653 /*****************************************************************************/ 638 654 /* */ 639 /* Version 5.3 29.09.02 No changes. */ 640 /* Version 5.2 18.09.02 No changes. */ 641 /* Version 5.1 08.09.02 Added conditional changes for MacOS/MacPerl. */ 642 /* Version 5.0 10.10.01 New YMD/HMS functions, replaced <ctype.h>, ... */ 643 /* Version 4.3 08.01.00 decode_date_??: (yy < 70 ? 20yy : 19yy) */ 644 /* Version 4.2 07.09.98 No changes. */ 645 /* Version 4.1 08.06.98 Fixed bug in "add_delta_ymd()". */ 646 /* Version 4.0 12.05.98 Major rework. Added multi-language support. */ 647 /* Version 3.2 15.06.97 Added "week_of_year()". */ 648 /* Version 3.1 12.06.97 No significant changes. */ 649 /* Version 3.0 16.02.97 Changed conventions for unsuccessful returns. */ 650 /* Version 2.3 22.11.96 Fixed unbalanced "malloc" and "free". */ 651 /* Version 2.2 26.05.96 No significant changes. */ 652 /* Version 2.1 26.05.96 Fixed HH MM SS parameter checks. */ 653 /* Version 2.0 25.05.96 Added time calculations. Major rework. */ 654 /* Version 1.6 20.04.96 Not published. */ 655 /* Version 1.5 14.03.96 No significant changes. */ 656 /* Version 1.4 11.02.96 No significant changes. */ 657 /* Version 1.3 10.12.95 Added "days_in_month()". */ 658 /* Version 1.2b 27.11.95 No significant changes. */ 659 /* Version 1.2a 21.11.95 Fix for type name clashes. */ 660 /* Version 1.1 18.11.95 Fix for type name clashes. */ 661 /* Version 1.01 16.11.95 Improved compliance w/ programming standards. */ 662 /* Version 1.0 14.11.95 First version under UNIX (with Perl module). */ 663 /* Version 0.9 01.11.93 First version of C library under MS-DOS. */ 655 /* Version 5.4 03.10.04 Added compiler directives for C++. */ 656 /* Version 5.3 29.09.02 No changes. */  
