1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-18 19:39:55 +00:00

Improve timeline macro

This commit is contained in:
Jermolene 2014-09-08 18:58:48 +01:00
parent c1de85838f
commit c6c4cf2289
4 changed files with 28 additions and 5 deletions

View File

@ -2,4 +2,4 @@ title: $:/core/ui/MoreSideBar/Recent
tags: $:/tags/MoreSideBar
caption: {{$:/language/SideBar/Recent/Caption}}
<<timeline>>
<$macrocall $name="timeline" format={{$:/language/RecentChanges/DateFormat}}/>

View File

@ -2,4 +2,4 @@ title: $:/core/ui/SideBar/Recent
tags: $:/tags/SideBar
caption: {{$:/language/SideBar/Recent/Caption}}
{{$:/snippets/recentchanges}}
<$macrocall $name="timeline" format={{$:/language/RecentChanges/DateFormat}}/>

View File

@ -1,10 +1,11 @@
title: $:/core/macros/timeline
tags: $:/tags/Macro
\define timeline()
<$list filter="[!is[system]has[modified]!sort[modified]limit[100]eachday[modified]]">
\define timeline(limit:"100",format:"DDth MMM YYYY")
<div class="tc-timeline">
<$list filter="[!is[system]has[modified]!sort[modified]limit[$limit$]eachday[modified]]">
<div class="tc-menu-list-item">
<$view field="modified" format="date" template={{$:/language/RecentChanges/DateFormat}}/>
<$view field="modified" format="date" template="$format$"/>
<$list filter="[sameday{!!modified}!is[system]!sort[modified]]">
<div class="tc-menu-list-subitem">
<$link to={{!!title}}>
@ -14,4 +15,5 @@ tags: $:/tags/Macro
</$list>
</div>
</$list>
</div>
\end

View File

@ -0,0 +1,21 @@
title: TimelineMacro
tags: macros
modified: 20140905084423561
The timeline macro produces a list of tiddlers in reverse chronological order of modification date that is grouped by the date of the day of modification.
! Parameters
|!Position |!Name |!Description |!Default |
|1st |limit |The maximum number of tiddlers to list |100 |
|2nd |format |A DateFormat string for formatting the date |DDth MMM YYYY |
! Examples
```
<<timeline limit:30 format:"DD/MM/YYYY">>
```
Renders as:
<<timeline limit:30 format:"DD/MM/YYYY">>