Final change for calendar badge
I had been in contact with David on the possibility on getting some additional variables available for manipulating dates. This was induced by my tinkering with the look-n-feel for my blog and specifically to design and coding of the calendar badges.
Instead of just adding some variables David implemented formatting options by applying Moments, a library/toolkit specifically developed to ‘Parse, validate, manipulate, and display dates in JavaScript’.
The templates entry.html
and entries.html
are now using the following code
<div class="calendar">
<span class="month">{{#formatDate}}MMM{{/formatDate}}</span>
<span class="day">{{#formatDate}}D{{/formatDate}}</span>
<span class="year">{{#formatDate}}YYYY{{/formatDate}}</span>
</div>
instead of the old template that required additional jQuery code
<div class="calendar" data="{{date}}">
<span class="month"> </span>
<span class="day"> </span>
<span class="year"> </span>
</div>
For the template archives.html
the code has been update to this
<span class="archive">{{#formatDate}}DD{{/formatDate}}:</span> <a class="archive" href="{{url}}">{{title}}</a><br />
which was the following in the previous version (and also required additional jQuery code)
<span class="archive" data={{date}}>--:</span> <a class="archive" href="{{url}}">{{title}}</a><br />
Within scripts.js
all the blocks of code related to the calendar badge archives page have been removed.
Latest (full) versions of these files can be found on GitHub
David, thank you very much for implementing this feature!