Playing with functions;
I am learning and investigating how to use functions in TiddlyWiki 5.3.0 as they stand to allow us to make our own prepared filters and filter operators.
This simple function allows us to pass a fieldname to have it converted to a unix TIMESTAMP
\function timestamp(fieldname:"modified")
[all[current]get<fieldname>format:date[TIMESTAMP]]
\end
\define unix-days() 86400000
It is then possible to get the days between two dates as follows;
{{{ [<timestamp>subtract<timestamp created>divide<unix-days>round[]] }}}
But now I wish to write and use a function if possible which I can pass two fieldnames and return the same result as above.
- However I cant see how to do it.
Questions
- Can you see how to do this?,
- am I missing something?
- or is there a limitation to the way we can combine custom operators with parameters?