[ic] dropdown with week of the year ...

Andrei Gologan interchange-users@icdevgroup.org
Fri Aug 9 16:41:01 2002


Hi,

I need to make a dropdown box showing the week of the year and the year. It
needs to show the next 30 weeks starting at the actual one. The problem ist
when the year changes it should start over at week one again showing
someting like 01-2003 for example.

I am using following code to get the weeks and display them, but they go
over 53 and I dont know how to tell it to start at 1 again:

                <SELECT NAME=date_week>

                [loop option=date_wunsch lr=1 list=`
                my $weekyear = $Tag->time( '', { format => '%W' }, '%W' );
                my $week = '';
                for ($weekyear .. $weekyear +57) {
                        /(\d\d)/;
                        $last_two = $1;
                        $week .= "$last_two\t$_\n";
                }
                        return $week;
                `]

                <OPTION VALUE="[loop-code]"> [loop-pos 1]
                [/loop]
                </SELECT>

Any ideas ? or help ?

thank you
Andrei