Page 1 of 1

Calendar days

Posted: Thu Oct 05, 2006 8:58 pm
by Random
Quick question (I hope).

I'm working on the styling of a template to shift my blog to, and wanted to change the days of the week on the calendar from three-letter abbreviations (Mon, Tue, etc) to single-letter abbreviations (M, T, etc).

Presumably I edit the plugin_calendar.tpl file, somewhere around where it talks about 'dow' - but, knowing neither Smarty nor PHP, I'm not sure how. Can someone tell me what change I need to make?

Advice gratefully received!

(Blog is here, by the way.)

Posted: Thu Oct 05, 2006 9:18 pm
by carl_galloway
Its very easily done, simply make sure plugin_calendar.tpl is in your template folder, if not, then just copy it from the default folder.

Then open the file and where you see this

Code: Select all

    {foreach from=$plugin_calendar_dow item="dow"}
        <td scope="col" abbr="{$dow.date|@formatTime:"%A":false}" title="{$dow.date|@formatTime:"%A":false}" class="serendipity_weekDayName" align="center">{$dow.date|@formatTime:"%a":false|@truncate:3:'':true}</td>
    {/foreach}
Change the truncate in the second last line to 1, so your code reads like this;

Code: Select all

    {foreach from=$plugin_calendar_dow item="dow"}
        <td scope="col" abbr="{$dow.date|@formatTime:"%A":false}" title="{$dow.date|@formatTime:"%A":false}" class="serendipity_weekDayName" align="center">{$dow.date|@formatTime:"%a":false|@truncate:1:'':true}</td>
    {/foreach}

Posted: Thu Oct 05, 2006 9:55 pm
by Random
Brilliant, thanks, I had a feeling it would be something as simple as that!

In fact, my file had this in it, which explains perhaps why I didn't work it out myself...

Code: Select all

    <tr>
    {foreach from=$plugin_calendar_dow item="dow"}
        <td scope="col" abbr="{$dow.date|@formatTime:"%A":false}" title="{$dow.date|@formatTime:"%A":false}" class="serendipity_weekDayName" align="center">{$dow.date|@formatTime:"%a":false}</td>
    {/foreach}
    </tr>