Thank a lot! You guys are amazing! :)

On 9 Jan, 18:28, Eric Shulman <[email protected]> wrote:
> On Jan 9, 4:05 am, magev958 <[email protected]> wrote:
>
> > I'm trying to figure out how to display how many tiddler i've changed
> > last year. I have been trying ForEachTiddler and get a list of the
> > tiddler changed during the last 365 days. Not what I wanted, so I try
> > you guys (and girls, of course) to see if you have any good ideas ;)
>
> If you use
>    http://www.TiddlyTools.com/#InlineJavascriptPlugin
>
> you can then write:
>
> <script>
>    var count=0;
>    var now  =new Date();
>    var year =86400*365*1000; // msec per year
>    var tids =store.getTiddlers('modified').reverse();
>    for (var i=0; i<tids.length; i++)
>       if (now-tids[i].modified<year) count++;
>    return "You changed "+count+" tiddlers in the last 365 days";
> </script>
>
> Alternatively, if you want tiddlers created during the previous year
> (i.e., during "2011", as opposed to a moving 365-day window):
>
> <script>
>    var count=0;
>    var year=new Date().getYear()-1;
>    var tids =store.getTiddlers('modified').reverse();
>    for (var i=0; i<tids.length; i++)
>       if (tids[i].modified.getYear()==year) count++;
>    return "You changed "+count+" tiddlers last year";
> </script>
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
>
> ----
> TiddlyTools needs YOUR financial support...
> Help ME to continue to help YOU...
> make a generous donation today:
>    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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to