Hi,

So here is my need 
I have a date field (lets call it: "myDate") that is not formated: values 
can be "12-02-2015" , "Dec 2016", "Q3 2017" or "2018"
I want to extract the year for display and sorting purposes.

so I usually write right(myDate,4)

now this does not seem to be core. So look on this group i found this post 
<https://groups.google.com/forum/#!searchin/TiddlyWiki/string$20function|sort:date/tiddlywiki/55LEk-oaMj4/E2zAZN_BBwAJ>
 about 
substring using a javascript macro

This is close enough , for the substring part. If I want to operate on the 
title of the tiddler , I can modify the code as per below (tested it works 
well

[...]

exports.name = "substr";
exports.params = [
                              {name: "size",default:"0"},
]; 
/*
Run the macro
*/
exports.run = function(size) {

var tiddlertitle= this.getVariable("currentTiddler");


     return tiddlertitle.substring(tiddlertitle.length-size);

[...]



And this works well on the title , but I would like to reach the myDate 
field

Am I going in the right direction ? What would be the syntax ? I could not 
find tips on this
Thanks for your kind help here
Francois

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b387beaf-8f17-42a8-88b9-3cf880491b64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to