mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-22 01:08:44 +00:00
Improve timeline macro
This commit is contained in:
@@ -2,4 +2,4 @@ title: $:/core/ui/MoreSideBar/Recent
|
|||||||
tags: $:/tags/MoreSideBar
|
tags: $:/tags/MoreSideBar
|
||||||
caption: {{$:/language/SideBar/Recent/Caption}}
|
caption: {{$:/language/SideBar/Recent/Caption}}
|
||||||
|
|
||||||
<<timeline>>
|
<$macrocall $name="timeline" format={{$:/language/RecentChanges/DateFormat}}/>
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ title: $:/core/ui/SideBar/Recent
|
|||||||
tags: $:/tags/SideBar
|
tags: $:/tags/SideBar
|
||||||
caption: {{$:/language/SideBar/Recent/Caption}}
|
caption: {{$:/language/SideBar/Recent/Caption}}
|
||||||
|
|
||||||
{{$:/snippets/recentchanges}}
|
<$macrocall $name="timeline" format={{$:/language/RecentChanges/DateFormat}}/>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
title: $:/core/macros/timeline
|
title: $:/core/macros/timeline
|
||||||
tags: $:/tags/Macro
|
tags: $:/tags/Macro
|
||||||
|
|
||||||
\define timeline()
|
\define timeline(limit:"100",format:"DDth MMM YYYY")
|
||||||
<$list filter="[!is[system]has[modified]!sort[modified]limit[100]eachday[modified]]">
|
<div class="tc-timeline">
|
||||||
|
<$list filter="[!is[system]has[modified]!sort[modified]limit[$limit$]eachday[modified]]">
|
||||||
<div class="tc-menu-list-item">
|
<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]]">
|
<$list filter="[sameday{!!modified}!is[system]!sort[modified]]">
|
||||||
<div class="tc-menu-list-subitem">
|
<div class="tc-menu-list-subitem">
|
||||||
<$link to={{!!title}}>
|
<$link to={{!!title}}>
|
||||||
@@ -14,4 +15,5 @@ tags: $:/tags/Macro
|
|||||||
</$list>
|
</$list>
|
||||||
</div>
|
</div>
|
||||||
</$list>
|
</$list>
|
||||||
|
</div>
|
||||||
\end
|
\end
|
||||||
|
|||||||
@@ -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">>
|
||||||
Reference in New Issue
Block a user