Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Short Date displayed locally

Quote Reply
Short Date displayed locally
In links 2 I was able to display only Day and Month locally by adding this code in sub site_html_link in site_html_templates:

my $shortdate = $rec{'Date'};
$shortdate =~ s/(\w+-\w+)-\w+/$1/;

and

shortDate => $shortdate,

Would anybody be able to give me advise on how to do this in Links SQL?

----

Actually I solved the problem by doing this:

In HTML_Templates.pm I added:

sub convert_date {
# ---------------------------------------
my $in = shift;
my %months = qw!1 Jan 2 Feb 3 Mar 4 Apr 5 May 6 Jun 7 Jul 8 Aug 9 Sep 10 Oct 11 Nov 12 Dec!;
my ($year, $mon, $day) = split /-/, $in;
return "$months{int $mon} $day";
}

and in the link.html used %Disp_Date%

[This message has been edited by Brian Dentry (edited April 05, 2000).]