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
--
ShawnDowler - 09 Oct 2008
Answer
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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