#!/perl/bin/perl use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use Date::Calc qw(Add_Delta_Days Day_of_Week); use strict; # DATE DROPDOWN (last 30 business days) common wherever found my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); $mon++; $year += 1900; my (@date_dd_from,@date_dd_to); #Sample dates my $selected_date_from = "1/21/2008"; my $selected_date_to = "1/21/2008"; for (my $x = 1; $x < 45; $x++) # 45 days later { ($year,$mon,$mday) = Add_Delta_Days($year,$mon,$mday,1); my $dow = Day_of_Week($year,$mon,$mday); if (($dow != 6) && ($dow != 7)){ if ("$mon/$mday/$year" eq "$selected_date_from"){ push(@date_dd_from,"<option selected value=\"$mon/$mday/$yea +r\">$mon/$mday/$year</option>\n"); }else{ push(@date_dd_from,"<option value=\"$mon/$mday/$year\">$ +mon/$mday/$year</option>\n"); } if ("$mon/$mday/$year" eq $selected_date_to){ push(@date_dd_to,"<option selected value=\"$mon/$mday/$year\ +">$mon/$mday/$year</option>\n"); }else{ push(@date_dd_to,"<option value=\"$mon/$mday/$year\">$mo +n/$mday/$year</option>\n"); } } } print "\n@date_dd_to\n";
In reply to Getting the Latest Date Issue by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |