Hi!
Try this:
<script>
var years = [];
var e, f;
var eventsAll = store.getTaggedTiddlers("Event");
for (e = 0; e < eventsAll.length; e++) {
years.pushUnique(eventsAll[e].fields.event_year);
}
years.sort();
for (f = 0; f < years.length; f++) {
wikify("!" + years[f] + "\n", place);
for (e = 0; e < eventsAll.length; e++) {
if (eventsAll[e].fields.event_year === years[f]) {
wikify("!!" + eventsAll[e].fields.event_month + "\n*" +
eventsAll[e].title + "\n", place);
}
}
}
</script>
It probably needs some tweaking to match your needs. Years are sorted,
but months and events aren't.
w
On 5 dec., 18:34, passingby <[email protected]> wrote:
> Hello friends,
> I am creating a simple TW to note down the events of my personal life. Each
> tiddler tagged as 'Event' has following fields:
> event_what, event_when, event_why, event_who, event_how
> These event tiddlers show as an html input form when in edit mode and
> tabular form when in view mode(with help of TaggedTemplateTweakPlugin).
>
> Now what I need is to create a timeline in which all event tiddlers are
> listed after being grouped into years, then months and then date wise. So
> my list should look like this:
> !2011
> !!1 (January)
> *[[abc_event_in_jan]]
> *[[xyz_event_in_jan]]
> !!5 (May)
> *[[jkjhkj_event]]
> *[[vdfvdf]]
> !2012
> !!4 (April)
> *[[some_event_in_April]]
> *[[another-event-in-April]]
>
> So in order to accomplish this I am trying to use inline script something
> like this:
> <script>
> var years={};
> var events= store.getTaggedTiddlers("Event");
>
> for(var e=0;e<events.length;e++){
> var y= events[e].fields.event_year;
> var m=events[e].fields.event_month;
> if(years[y]===undefined) years[y]={};
> if(years[y][m]===undefined) years[y][m]=[]
> years[y][m].push(events[e]);
> }
> </script>
>
> So now I have an object which contains properties according to month
> numbers which are associated with arrays which contain the event tiddlers.
> Now what I want is to print out the years (asc/desc) and then months
> (asc/desc) and then a list of event tiddlers in that month sorted on date.
> I'd be grateful if you could provide a little idea how this can be done.
--
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.