Question
I modified the
BugsContrib pages in order to use them for a specific task within our corp. One of the things I had to change was the format dates were displayed when displaying search results. The default format of $data and $createdate is a signature style date(20 Jul 2006). What I wanted was simply to format those dates to an iso standard. Pretty simple for $date, I simply used $isodate. However for an unknown reason I wasn't able to find such thing for $createdate. I decided to search around for a way to convert my $createdate into an iso format. Turns out CALC was a good way to do it. So I tried
%CALC{"$FORMATTIME(TIME($createdate), $year-$month-$day)"}%
It does return a date, but the current time. Why you ask? because FORMATTIME format current time when no value is used. That's where my problem lies. TIME($createdate) retruns either nothing or 0. I figured out maybe the date format wasn't supported, but it is: if I do TIME(19 Jul 2006 - 19:39) it will return me the serialized string for this time stamp. My other thought was maybe TWiki parses the spreadsheet instructions before the search's. It doesn't. I tryed to set a varaible containning my date using the spreadsheet method : SET(date, $date), it does set the data and when I use GET(date) it shows me the date. If I try TIME(GET(date)) however it'll return 0.
Any input on how I could perform my change?
TIA
--
MarcBoivin - 20 Jul 2006
Environment
--
MarcBoivin - 20 Jul 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Here is the issue assuming you are doing a SEARCH: The CALC fires off too early. You need to escape it so that it runs once for each SEARCH hit. Write
$percntCALC{$FORMATTIME($TIME($createdate), $year-$month-$day)}$percnt in your SEARCH
format="".
--
PeterThoeny - 20 Jul 2006