This is a stripped-down version of a single section of Grok TiddlyWiki, optimized for fast loading and readability by search engines. Some features are missing.

For the full Grok TiddlyWiki experience, please visit the wiki version of this page.

Ex:DateFormatter/answer

 10th October 2024 at 8:19am

Here's my version. You presumably have something slightly different.

\procedure show-date(fmt) <$view tiddler={{!!selectedtiddler}} field={{!!selectedfield}} format="date" template=<<fmt>>>(not a date)</$view>

\procedure date-row(name, fmt)
<tr>
  <td><<name>></td>
  <td><$transclude $variable="show-date" fmt=<<fmt>>/></td>
</tr>
\end

Tiddler:
<$select field="selectedtiddler" default="">
    <option value="">(choose a tiddler)</option>
    <$list filter="[!is[system]]">
        <option value=<<currentTiddler>>><<currentTiddler>></option>
    </$list>
</$select>

<!-- Don't show the field drop-down if no tiddler is selected, since it won't contain any options. -->
<% if [all[current]get[selectedtiddler]!is[blank]] %>
Field:
<$select field="selectedfield" default="created">
    <$list filter="[{!!selectedtiddler}fields[]]">
        <option value=<<currentTiddler>>><<currentTiddler>></option>
    </$list>
</$select>
<% endif %>

<% if [all[current]has[selectedtiddler]has[selectedfield]] %>
<table>
    <tr>
        <th>Format</th>
        <th>Date</th>
    </tr>
    <$list filter="[prefix[$:/config/DateFormatter/Formats/]]" variable="currentFormat">
        <$transclude $variable="date-row"
            name={{{ [<currentFormat>removeprefix[$:/config/DateFormatter/Formats/]] }}} 
            fmt={{{ [<currentFormat>get[text]] }}}/>
    </$list>
</table>
<% endif %>
Go to question: Ex:DateFormatter