Hi,
Not sure if anyone else has encountered this problem - but I'm having a hell of a time with dates in the templates :(
If we pass in a date - i.e 2007-10-21 , it AUTOMATICALLY gets converted into the %ddd% %mmm% %dd% %yyyy% format.
This is a real PITA on the current plugin I'm working on (I've managed to get around it, but I'm not happy at the way I've had to do it :()
I basically had to convert dates being passed into the template - so:
2007-10-21
..becomes:
2007 - 10 - 21
Then, pass it BACK to a function, to replace the - to normal - i.e:
my $date = $_[0];
$date =~ s/ - /-/sig;
return $date;
}
Surely there has to be a better way than this? Not very elegant at all - although it does work now (which is something)
TIA
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Not sure if anyone else has encountered this problem - but I'm having a hell of a time with dates in the templates :(
If we pass in a date - i.e 2007-10-21 , it AUTOMATICALLY gets converted into the %ddd% %mmm% %dd% %yyyy% format.
This is a real PITA on the current plugin I'm working on (I've managed to get around it, but I'm not happy at the way I've had to do it :()
I basically had to convert dates being passed into the template - so:
2007-10-21
..becomes:
2007 - 10 - 21
Then, pass it BACK to a function, to replace the - to normal - i.e:
Code:
sub { my $date = $_[0];
$date =~ s/ - /-/sig;
return $date;
}
Surely there has to be a better way than this? Not very elegant at all - although it does work now (which is something)
TIA
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!