Hi Tobias

> Would this help to get to the right evaluated 
> statement?http://www.w3schools.com/jsref/jsref_getday.asp

Yes I think/hope so - thank you very much :-)

> Something like:
> <<tiddler OnlyOnSundays if:{{(new Date()).getDay()==0;}}>>
>
> In case you have multiple valid weekdays, e.g. "weekends", you could
> check for...
> <<tiddler OnlyForWeekends if:{{
> [0,1].contains((new Date()).getDay());
>
> }}>>
>
> You could do a similar check for months for something like...
> "Welcome back to our new years special"
>
> But, if you really need the two alternatives, you might as well do
> this, without requiring CoreTweak 890 at all...
>
> <<tiddler {{
> [0,1].contains((new
> Date()).getDay())?"WeekendTiddler":"WeekDayTiddler"
>
> }}>>
>
> Come to think of it, it much looks like one really never needs
> CoreTweak 890. Since <<tiddler "">> doesn't render anything, you can
> apply the above trick under any condition. So, your basic conditional
> tiddler makro simply looks like this:
>
> <<tiddler {{condition?"IfTrueShowThis":""}}>>
>
> Whereas condition corresponds to a syntactically correct boolean
> expression.

Your thoughts on this matter are very *very* welcome, - my
intellectual capacity (and js-experience) is however not quite there
yet I'm afraid ....

Kriss had a question in november:
http://groups.google.com/group/tiddlywiki/browse_thread/thread/121884cf0cef5ebf/ad3aed3606e19c28
which seems to be similar (in some respect ??..)...

Would you be so kind to write an example where "condition" is a
boolean expression which asks if Today is Thursday
"IfTrueShowThis":"TiddlerYesThisIsThursday" ???

Q:
If I write this: "<<tiddler {{
[0,1].contains((new
Date()).getDay())?"WeekendTiddler":"WeekDayTiddler"
}}>> "
It will show the content of WeekDayTiddler if date is 0 or 1 ?? -
Is 0 and 1 always Sunday and Monday - or must I define those
"somewhere" in the script - like:
 var d=new Date();
var weekday=new Array(7);
weekday[0]="Sunday";
weekday[1]="Monday";)

Or is it WeekendTiddler which defines what days that are weekenddays??

Hmm -
As you can tell - from my questions - I'm a "little" out of my league
here :-)

Cheers Måns Mårtensson

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to tiddlywiki@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to