Tags:
create new tag
view all tags

Question

As a workaround for sorting searches by dates that does not require using tables I have created a Form field that I want to convert a date from the Topic that uses the form to an epoch date that I can search for and sort.

I want this text in every form by default:

%CALC{"$TIME(%FORMFIELD{"EntryDate"}%)"}%

I have tried the following:

 
$percntCALC{$quot$TIME($percntFORMFIELD{$quotEntryDate$quot}$percnt)$quot}$nop%

As well as other methods of escaping the quotation marks, but when I try to use the form, the text never gets put in the form fields past the

%CALC{
portion of the string.

Is there something I'm missing here? Is there an easier way to perform this calculation on every page and have in included in the Template? I'd rather have the default value from the Form, but either would do.

Environment

TWiki version: TWikiRelease04x02x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Forms

-- ShawnDowler - 09 Oct 2008

Answer

ALERT! 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.

What are you storing in EntryDate? Would one of the existing fields (createdate or date last edited) work instead?

-- SeanCMorgan - 11 Oct 2008

I'm storing a Journal entry date, so Createdate would only work if the journal entry were made for the current day. This is a journal that was written between 2000 and 2002, so I want to sort them by the entry date, not page creation date.

-- ShawnDowler - 13 Oct 2008

Within a SEARCH format, use this:

$percntCALC{$TIME($formfield(EntryDate))}$pernt

-- PeterThoeny - 10 Dec 2008

Change status to:
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2008-12-10 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.