On Monday, July 20, 2020 at 9:39:00 AM UTC-7, Joshua Baller wrote:
>
> I have a wiki (5.1.22) that is partly updated through importing large sets 
> (1000s) of tiddlers from a few JSON files on an approx. weekly basis 
> (knowledge base, the information is being maintained and updated on a 
> different system). I would like to know the last edit/update dates for a 
> particular tiddler was imported in this way, however when imported the 
> 'created' and 'modified' fields are left blank. 
>
> My preference would be to simply have the field populated on import as 
> this seemed like the expected behavior. Is there a setting I'm missing to 
> get this to occur? Otherwise is there are way to target only the recently 
> imported tiddlers to have their 'created' dates populated?
>

While it might seem to you to be the expected behavior, importing tiddlers 
will NEVER add or alter any fields in the incoming tiddlers.  This is by 
design, since there may be unwanted side-effects of changing the tiddler 
definitions, even if it is just to add a "created" or "modified" date.

However, you *can* perform a "fixup" process after importing, by using the 
following button:
<$button> set missing created/modified fields
<$list filter="[all[tiddlers]!is[system]!has[created]]">
   <$action-setfield created=<<now "YYYY0MM0DD0hh0mm0ss0XXX">> modified=<
<now "YYYY0MM0DD0hh0mm0ss0XXX">> />
</$list>
</$button>

This button does a $list to find all tiddlers that do not have a "created" 
field
(excluding system tiddlers... those starting with "$:/").  For each tiddler 
it finds,
it sets the "created" AND "modified" fields of that tiddler to the current 
datetime,
using the standard 17-digit TWCore date format for those fields.

enjoy,
-e


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" 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/tiddlywiki/210e64a5-c498-454d-b66f-4ef6732197edo%40googlegroups.com.

Reply via email to