Hi Antaeus,
There's are these core functions:
*parseDate* — parses a datestring into a js date object
*stringifyDate* — does the reverse
So, something like this should do the trick of shifting by a given number
of days...
function(datestring, shiftbydays) {
var date =
That code looks nice and clean, and might do everything Antaeus wants ...
EXCEPT that it can't (or at least I don't think it can) be used inside a
button the way he wants.
The solution is to rewrite the javascript code so that it accepts values
from <$set> variables outside instead of
How about
http://t5a.tiddlyspot.com/#%24%3A%2Fplugin%2Fajh%2Ftiddlytime%2FDateTime.js
Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5
Original message
From: Antaeus Feldspar
Date: 10/06/2015 7:13 PM (GMT-07:00)
To: TiddlyWiki
I absolutely plan to offer it for public consumption when I have it working
well. I also have some ideas for some useful filter-operators, but since I'm
just getting started with the macros, the filter-operators are some distance in
the future!
--
You received this message because you are
Actually, perhaps I should share what my macro will do - I went looking to see
if there was an existing plugin that handled such things, and didn't find one,
but that could be just because I wasn't looking in the right places.
My macro will take a 17-character string as used in a Date field as
Hi Antaeus,
Tobias, you're right that the best solution may end up being something
> other than a macro, but to keep the project going, I have a deep need to be
> able to update certain data fields easily in great numbers of tiddlers. An
> imperfect solution now is tons better than a perfect
Hi Mark
As you’ve discovered, this doesn’t work:
<>
Instead, you can use the <$macrocall> widget to invoke the macro. For example:
<$macrocall $name=“textMaker” myParam={{!!myField}}/>
Widgets are the fundamental unit of functionality in TiddlyWiki; all the other
wikitext syntax is just
Hi Antaeus
> Jeremy, could I please get your answer to my question?
I would have expected Tobias’s solution to work. Does it work for you?
> What is the right way to create a button that will read a value from a field,
> use that value as input to a macro to reach a new value, and then write
Hi Antaeus,
I can see how a js macro might be a simpler first step but perhaps a macro
isn't the best implementation for what it is you try to achieve, but rather
a widget or maybe a filter operator.
Best wishes,
— tb
--
You received this message because you are subscribed to the Google
Jeremy, could I please get your answer to my question?
What is the right way to create a button that will read a value from a field,
use that value as input to a macro to reach a new value, and then write that
value back to the same field?
I'm starting to get a bit discouraged that such a
Thank you, Jeremy and Tobias especially! I have it working now!
The first time I read Tobias' solution and tried my own based on it, it didn't
work for me. I don't know exactly what I was doing wrong (the text of that
attempt was lost by a browser crash), but every attempt to call the macro
Or, to express it a different way from the subject line, how can I create a
button widget that will:
a) take the current value of a tiddler field;
b) use that current value as a parameter to a macro to calculate a new value;
and
c) put that new value back into the tiddler field that was read?
Hi Mark
> 3) You can use a macro inside a widget IF it doesn't have a parameter
That is not correct. Macro invocations used as widget attributes may have
parameters.
However, there are a couple of points to watch:
* The output of the macro is not wikified; it is used directly as the value of
Hi Jeremy,
But, at the bottom line, is there any way to set up Tobias' solution
without resorting to <$set> (or <$var>) ?
Thanks!
Mark
On Saturday, October 3, 2015 at 3:31:53 PM UTC-7, Jeremy Ruston wrote:
>
> Hi Mark
>
> 3) You can use a macro inside a widget IF it doesn't have a parameter
>
14 matches
Mail list logo