A startup module defining extra fields works, I've done it in the past for 
a plugin for dates and fields I wanted treated as an array.
Eg:

$tw.modules.define("$:/boot/tiddlerfields/sq-duedate","tiddlerfield",{
        name: "sq-duedate",
        parse: $tw.utils.parseDate,
        stringify: $tw.utils.stringifyDate
});


On Wednesday, May 20, 2020 at 2:17:57 AM UTC+2, Joshua Fontany wrote:
>
> Hi Tony,
>
> What you are looking for is declared in `boot.js`before the wiki is 
> actually started, from line 994:
>
> ```
> /*
> Register and install the built in tiddler field modules
> */
> $tw.modules.define("$:/boot/tiddlerfields/modified","tiddlerfield",{
> name: "modified",
> parse: $tw.utils.parseDate,
> stringify: $tw.utils.stringifyDate
> });
> $tw.modules.define("$:/boot/tiddlerfields/created","tiddlerfield",{
> name: "created",
> parse: $tw.utils.parseDate,
> stringify: $tw.utils.stringifyDate
> });
> $tw.modules.define("$:/boot/tiddlerfields/color","tiddlerfield",{
> name: "color",
> editTag: "input",
> editType: "color"
> });
> $tw.modules.define("$:/boot/tiddlerfields/tags","tiddlerfield",{
> name: "tags",
> parse: $tw.utils.parseStringArray,
> stringify: $tw.utils.stringifyList
> });
> $tw.modules.define("$:/boot/tiddlerfields/list","tiddlerfield",{
> name: "list",
> parse: $tw.utils.parseStringArray,
> stringify: $tw.utils.stringifyList
> });
> ```
>
> I think this is worth exploring, but will have to think on it. You should 
> be able to setup a startup module to define other parse/stringify 
> definitions.
>
> Best,
> Joshua Fontany
>
> On Tuesday, May 19, 2020 at 6:40:43 AM UTC-7, TonyM wrote:
>>
>> Folks,
>>
>> You may be aware if you transclude a few of the standard fields like
>> {{!!created}}
>> {{!!modified}}
>>
>> What is returned is not the ugly date serial numbers, but
>>
>> Tue May 19 2020 23:34:40 GMT+1000 (Australian Eastern Standard Time)
>>
>> Tue May 19 2020 23:35:52 GMT+1000 (Australian Eastern Standard Time)
>>
>>
>> I believe this is a core mechanism, but since I am 90% of the way into 
>> building a tool to build field definitions I thought it important to ask if 
>> anyone knows how this is done?
>>
>>
>> I would like to know if I can hack this for other fields or possibly 
>> request a change to be able to do so. 
>>
>>
>> I have searched for it but do not know how to find it, since it uses a 
>> basic transclusion method, yet treats these fields differently.
>>
>>
>> Thank in advance for any insight.
>>
>> TonyM
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/2e80e3aa-b42a-4f1d-852b-6945311a0454%40googlegroups.com.

Reply via email to