regarding date display
Paulo Casanova
paulo.casanova at link.pt
Fri Mar 4 18:54:24 UTC 2005
OK, so you've got a custom field and have created a new field in the bug
entry template, right?
You have a few choices here, but I'll put the first two that come to my
mind :)
1. You generate the default date in the CGI that generates your page
(enter_bug.cgi, I'll assume) and place in your template.
Say you'll have today's date in variable $mydate. Place a line with
$vars->{'today_date'} = $mydate;
near the other $vars->xxx declarations
In the template, just use the variable:
<input type="text" name="myfieldname" value="[% today_date %]">
This is only useful if, for some reason, you might want to change the
default date dynamically.
2. You fill in the text field directly in the template (probably the
easiest):
<input type="text" name="myfieldname" value="[%
function_that_returns_date() %]">
There are probably 1m ways to get the current date in an unimaginable
bunch of formats but I guess you're problem is not getting the date. You
can just call in any function between [% %] in the templates. The
function gets evaluated and its result is placed in the template.
I'm assuming your field is editable but if it's not, just ignore the <>
stuff :) like:
<p>
My text in the enter bug page
<br>
Here is todays's date: [% my_date %]
<p>
Hope it helps,
Paulo
More information about the developers
mailing list