> I am trying to make a newTiddler with today's date as the default a
> extended field. Here is what I have:
> <<newTiddler title:'NewToDo' label:'Add a new To Do' tag:'ToDo'
> fields:'duedate:{{(newDate()).formatString("YYYY-0MM-0DD")}}'>>
> This gives me (newDate()).formatString("YYYY-0MM-0DD") in the field.
To initialize a field via "computed parameters", you need to construct
the entire field:value reference within the {{...}} javascript code
block. Thus, instead of writing:
fields:'duedate:{{(newDate()).formatString("YYYY-0MM-0DD")}}
you need to write:
fields:{{"duedate:"+(new Date()).formatString("YYYY-0MM-0DD")}}>>
(i.e., include the "duedate:" syntax as part of the computed text that
will be used)
> I have installed DatePlugin, InlineJavaScript, and this (http://
> tiddlywiki.pastebin.com/f24de1652) which helps out with pre-filling
> extended fields.
The 'formatString()' function is provided by the TW core... thus, to
use this computed parameter code, you do *not* need DatePlugin or
InlineJavascriptPlugin.
However...
The value used by <<newTiddler>> in the duedate: custom field is
computed when the macro is initially *rendered* into the content, not
when it is subsequently *clicked* upon. Thus, if you open the
document and leave it open over night, the computed value for the
'duedate' custom field will no longer be current.
Fortunately, there is a way to force the computed parameter to be re-
processed when the click event actually occurs, so that it will be re-
calculated using the current time value:
http://www.TiddlyTools.com/#ClickifyPlugin
usage:
<<clickify macroName param param param>>
(i.e., just add 'clickify' in front of the usual macro name)
example:
<<clickify newTiddler title:'NewToDo' label:'Add a new To Do'
tag:'ToDo' fields:{{"duedate:"+(new Date()).formatString
("YYYY-0MM-0DD")}}>>
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---