Hi,
the above plugin has been working very well !!
Want I would like to try and do is incorporate an expiry date on a tiddler.
Use a field of some sort to pick the date up and it would then put an icon
next to the link to say it has expired ?
Would this be possible
Thanks
On Thursday, November 8, 2012 5:53:56 PM UTC+8, whatever wrote:
>
> Hi!
>
> Well, this code shows the icon for the whole period. If I understand
> correctly, you want two different icons for two different periods.
> Here's the code:
>
> <<forEachTiddler
> script '
> function lastDays(tiddler) {
> var compareDate1 = new Date();
> var compareDate2 = new Date();
> compareDate1.setDate(compareDate1.getDate() - 30);
> compareDate2.setDate(compareDate2.getDate() - 60);
> if ((tiddler.modified > compareDate2) && (tiddler.modified <
> compareDate1))
> return "* [[" + tiddler.title + "]] <<tiddlerIcons recent [[=" +
> tiddler.title + "]]>\>\n";
> else if (tiddler.modified > compareDate1)
> return "* [[" + tiddler.title + "]] <<tiddlerIcons changed [[=" +
> tiddler.title + "]]>\>\n";
> else
> return "* [[" + tiddler.title + "]]\n";
> }'
>
> write 'lastDays(tiddler)'
> >>
>
> w
>
>
> On 8 nov., 10:07, Philippe De Feularde <[email protected]>
> wrote:
> > Hi and thank you all for your help - Its me not explaining very well so
> > sorry.
> >
> > This is close but I want a different icon showing for the 30 day period
> and
> > another icon showing for the 60 day mark so when listed it would either
> > show an icon within the 30 day period or a different icon for the 60
> > day period or other wise no icon if no criteria met. Hope this is
> possible
> >
> > thank you
> >
> >
> >
> >
> >
> >
> >
> > On Thursday, November 8, 2012 4:27:32 PM UTC+8, whatever wrote:
> > > Hey! You complicated stuff a little.:) Or I didn't explain well.
> > > Anyway, here's the code:
> >
> > > <<forEachTiddler
> > > script '
> > > function lastDays(tiddler) {
> > > var compareDate1 = new Date();
> > > var compareDate2 = new Date();
> > > compareDate1.setDate(compareDate1.getDate() - 30);
> > > compareDate2.setDate(compareDate2.getDate() - 60);
> > > if ((tiddler.modified > compareDate2) && (tiddler.modified <
> > > compareDate1))
> > > return "* [[" + tiddler.title + "]] <<tiddlerIcons recent [[=" +
> > > tiddler.title + "]]>\>\n";
> > > else
> > > return "* [[" + tiddler.title + "]]\n";
> > > }'
> >
> > > write 'lastDays(tiddler)'
> >
> > > w
> >
> > > On 8 nov., 01:41, Philippe De Feularde <[email protected]>
> > > wrote:
> > > > Hi
> >
> > > > Sorry could you give me an exmaple please, I tried - would this
> bring up
> > > > two different Icons so Date 1 could be
> > > > return "* [[" + tiddler.title + "]] <<tiddlerIcons settings [[=" +
> > > > tiddler.title + "]]>\>\n";
> >
> > > > and Date 2
> > > > return "* [[" + tiddler.title + "]] <<tiddlerIcons recent [[=" +
> > > > tiddler.title + "]]>\>\n";
> >
> > > > this is what I tried
> >
> > > > <<forEachTiddler
> > > > where
> > > > 'tiddler.tags.contains("tag here")'
> > > > script '
> > > > function lastDays(tiddler) {
> > > > var compareDate1 = new Date();
> > > > compareDate1.setDate(compareDate1.getDate() - 30);
> > > > if ((tiddler.modified > compareDate2) && (tiddler.modified <
> > > > compareDate1))
> > > > return "* [[" + tiddler.title + "]] <<tiddlerIcons settings [[=" +
> > > > tiddler.title + "]]>\>\n";
> > > > var compareDate2 = new Date();
> > > > compareDate2.setDate(compareDate2.getDate() - 60);
> > > > if ((tiddler.modified > compareDate2) && (tiddler.modified <
> > > > compareDate1))
> > > > return "* [[" + tiddler.title + "]] <<tiddlerIcons recent [[=" +
> > > > tiddler.title + "]]>\>\n";
> > > > else
> > > > return "* [[" + tiddler.title + "]]\n";}'
> >
> > > > write 'lastDays(tiddler)'
> >
> > > > And thank you saw the popup text, all done
> >
> > > > Regards
> >
> > > > On Wednesday, November 7, 2012 3:41:00 PM UTC+8, whatever wrote:
> >
> > > > > Hi!
> > > > > Yes, you figured it out correctly:
> > > > > compareDate.setDate(compareDate.getDate() - 30);
> >
> > > > > As for a range, you'd need to have to time points, so you need to
> do
> > > > > some changes:
> >
> > > > > var compareDate1 = new Date();
> > > > > var compareDate2 = new Date();
> > > > > compareDate1.setDate(compareDate1.getDate() - 30);
> > > > > compareDate2.setDate(compareDate2.getDate() - 60);
> > > > > if ((tiddler.modified > compareDate2) && (tiddler.modified <
> > > > > compareDate1))
> >
> > > > > As you can see, there are now two compareDates instead of one and
> > > > > tiddler.modified needs to be between them.
> > > > > The rest is the same.
> >
> > > > > w
> >
> > > > > On 7 nov., 07:29, Philippe De Feularde <[email protected]>
>
> > > > > wrote:
> > > > > > Can I push it - is there a way for another icon for 30 - 60 days
> ?
> >
> > > > > > On Monday, November 5, 2012 7:48:24 PM UTC+8, whatever wrote:
> >
> > > > > > > Hi!
> >
> > > > > > > Try the following (beware googlewrap):
> >
> > > > > > > <<forEachTiddler
> > > > > > > script '
> > > > > > > function lastDays(tiddler) {
> > > > > > > var compareDate = new Date();
> > > > > > > compareDate.setDate(compareDate.getDate() - 10);
> > > > > > > if (tiddler.modified > compareDate)
> > > > > > > return "* [[" + tiddler.title + "]] <<tiddlerIcons recent [[="
> +
> > > > > > > tiddler.title + "]]>\>\n";
> > > > > > > else
> > > > > > > return "* [[" + tiddler.title + "]]\n";
> > > > > > > }'
> > > > > > > write 'lastDays(tiddler)'
> >
> > > > > > > This should show icons next to tiddlers changed in the last 10
> > > days.
> > > > > > > Change "recent", if you want a different icon. Icon settings
> are
> > > > > > > dependent on TiddlerIconsPluginConfig.
> >
> > > > > > > w
> >
> > > > > > > On 5 nov., 04:00, Philippe De Feularde <
> [email protected]>
> >
> > > > > > > wrote:
> > > > > > > > Hi Eric,
> > > > > > > > and a BIG thank you for your quick reply.
> >
> > > > > > > > Im a little confused.
> >
> > > > > > > > when we use ForEachTiddler we are assigning the list with
> tags
> > > so
> > > > > for
> > > > > > > > example
> >
> > > > > > > > <<forEachTiddler
> > > > > > > > where
> > > > > > > > 'tiddler.tags.contains("``rximag")'
> >
> > > > > > > > so this brings up our list of tiddlers with rximag, after a
> > > while
> > > > > there
> > > > > > > is
> > > > > > > > quite a lot of tiddlers in that section so next to the name
> we
> > > > > wanted
> > > > > > > icons
> > > > > > > > which are new so users can see what is new etc...
> >
> > > > > > > > I have imported what you have asked me to import but how do
> I
> > > assign
> > > > > > > images
> > > > > > > > to the tiddlers that are new etc..
> >
> > > > > > > > Regards
> >
> > > > > > > > Philippe
> >
> > > > > > > > On Monday, November 5, 2012 9:19:58 AM UTC+8, Eric Shulman
> > > wrote:
> >
> > > > > > > > > On Nov 4, 4:24 pm, Philippe De Feularde <
> > > > > [email protected]>
> > > > > > > > > wrote:
> > > > > > > > > > Is there a way to highlight new tiddlers with an icon so
> > > users
> > > > > can
> > > > > > > view
> > > > > > > > > the
> > > > > > > > > > newest tiddlers from the list? We use ForEachTiddler so
> we
> > > just
> > > > > want
> > > > > > > an
> > > > > > > > > > icon to highlight the tiddlers that have been changed
> within
> > > the
> > > > > > > last 30
> > > > > > > > > > days or added. Stretching it could there be an icon to
> see
> > > if
> > > > > it’s
> > > > > > > been
> > > > > > > > > > changed then a different icon if it has been added?
> >
> > > > > > > > > First, import the following plugins:
> > > > > > > > >http://www.tiddlytools.com/#TiddlerIconsPlugin
> > > > > > > > >http://www.tiddlytools.com/#TiddlerIconsPluginConfig
> > > > > > > > >http://www.tiddlytools.com/#AttachFilePluginFormatters
> >
> > > > > > > > > Next, import the attachment tiddlers tagged with 'silk'
> (also
> > > from
> > > > > > > > > tiddlytools.com). These are the actual .png format icon
> > > images
> > > > > used
> > > > > > > > > by the above plugins.
> >
> > > > > > > > > After saving-and-reloading.... you can use the
> > > <<tiddlerIcons>>
> > > > > macro:
> >
> > > > > > > > > <<tiddlerIcons>> - shows icons for the current tiddler
> > > > > > > > > <<tiddlerIcons =TiddlerName>> - shows icons for the
> specified
> > > > > tiddler
> > > > > > > > > <<tiddlerIcons iconID>> - shows a specific icon
> >
> > > > > > > > > For your purposes, you will want embed the "<<tiddlerIcons
> > > > > > > > > =TiddlerName>>" macro sequence into your ForEachTiddler
> > > output,
> > > > > > > > > substituting the name of the tiddler (i.e.
> "tiddler.title")
> > > being
> > > > > > > > > handled in the foreach processing. When that output is
> > > rendered,
> > > > > the
> > > > > > > > > <<tiddlerIcons>> macro will display the appropriate icons
> for
> > > the
> > > > > > > > > named tiddler. QED.
> >
> > > > > > > > > enjoy,
> > > > > > > > > -e
> > > > > > > > > Eric Shulman
> > > > > > > > > TiddlyTools / ELS Design Studios
> >
> > > > > > > > > HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP
> JAR"...
> > > > > > > > > http://www.TiddlyTools.com/#Donations
> >
> > > > > > > > > Professional TiddlyWiki Consulting Services...
> > > > > > > > > Analysis, Design, and Custom Solutions:
> > > > > > > > > http://www.TiddlyTools.com/#Contact
>
--
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 http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.