Hi, I have only now got to review the suitability of my previous procedure Group-dates procedure.json to deliver your requirement, and I note that it is may not be suitable for your colapsable details view, because that most likely needs a nested structure, where my procedure avoids nesting in favor of detecting the change in year/month day.
- Some CSS Wizz may be able to help.
I am keen on building a general solution for nested reports, but this is chalenging to design if it allows handling any number of nestings, that the user may specify. Although year/month/day is a common requirement.
- I am sure you dont need to make month tiddlers, but hey if you can make it work, go for it.
- In a way the method I used will “be somewhat difficult to understand by many” because it takes a whole new approach, so don’t be hard on yourself. It aims to be useable by everyone, not nessasarily understood by everyone (although some additional documentation would help).
The next step
I will start to investigate a solution to your problem and such problems in general. I expect it may still use a similar mechanisium, or a different structure all together. However here I am trying to write a general solution, innovate where possible and leverage some new tiddlywiki features to achive this, so my answer may not come too soon.
Here is a code pattern you may want to investitage in the mean time;
<$list filter="each year" variable=year>
Year header
<$list filter="each month in year" variable=moy>
Month header
<$list filter="each day in month of year" variable=dom>
Day header
<$list filter="each item" variable=item>
Item header
item template
Item footer
</$list>
Day footer
</$list>
Month footer
</$list>
Year Footer
</$list>
This could also be turned inside out item > dom > moy > year
- The header an footer of each level could use the details widget (search for this and other options) to make everything inside it collaps.
The date functions inside my last procedure may prove useful for us both, and in future versions.
[Post script] It seems evident that breaking dates into years, months and even day of month is a very common need so extracting these to groups for nested lists would make sense as a subset of a more general nested list solution. The difference between each date group is as little as YYYY 0MM and 0DD.
- Although there may be cases such as quarters, hours and minutes.