Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [afinlr] Global with four saturday-dates

Quote Reply
Re: [afinlr] Global with four saturday-dates In reply to
I've had some problems with the date function, which is why I've used pcalc in some cases over the GT::Date routines for calendar math.

If you were going to do it using GT::Date, you'd probably be better off doing it in a global, and avoiding issues with the parser. Since you are happy with the Links default date format:

Code:
sub {
Links::init_date();
my $today = GT::Date::date_get();
my $week1 = GT::Date::date_add($today, 7);
my $week2 = GT::Date::date_add($today, 14);
my $week3 = GT::Date::date_add($today, 21);
my $week4 = GT::Date::date_add($today, 28);
return ( {date1 => $week1, date2 => $week2, date3 => $week3, date4 => $week4} );
}


call this as <%get_dates%> or something like that.

Untested, but should work.

The problems I've hit have come with date formatting, and -- in your examples -- assigning functions in the templates. This is a simpler case than I initially took it for, so it's possible to do it as above, without much potential for problems.

Rather than simply adding 7 to today, I was looking at it as actually picking out the next 4 DDD-days of the week.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Subject Author Views Date
Thread Global with four saturday-dates Coyu 2003 Mar 31, 2004, 11:58 PM
Post Re: [Coyu] Global with four saturday-dates
pugdog 1897 Apr 1, 2004, 6:20 AM
Thread Re: [Coyu] Global with four saturday-dates
afinlr 1894 Apr 1, 2004, 7:29 AM
Thread Re: [afinlr] Global with four saturday-dates
pugdog 1887 Apr 1, 2004, 3:50 PM
Thread Re: [pugdog] Global with four saturday-dates
pugdog 1870 Apr 2, 2004, 4:54 AM
Post Re: [pugdog] Global with four saturday-dates
pugdog 1869 Apr 2, 2004, 5:12 AM