emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] [patch] Planner Calendar outputs a whole empty week


From: drkm
Subject: [emacs-wiki-discuss] [patch] Planner Calendar outputs a whole empty week
Date: Sun, 24 Jul 2005 17:41:56 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (windows-nt)

  Hi

  I found that 'planner-calendar' generate the following last
week when the last day of the month is a Sunday:

    <tr>
    <td class="... Monday"><span class="nonexistent">25</span></td>
    <td class="... Tuesday"><span class="nonexistent">26</span></td>
    <td class="... Wednesday"><span class="nonexistent">27</span></td>
    <td class="... Thursday"><span class="nonexistent">28</span></td>
    <td class="... Friday"><span class="nonexistent">29</span></td>
    <td class="... Saturday"><span class="nonexistent">30</span></td>
    <td class="... Sunday"><span class="nonexistent">31</span></td>
    <td class="... Monday">&nbsp;</td>
    <td class="... Tuesday">&nbsp;</td>
    <td class="... Wednesday">&nbsp;</td>
    <td class="... Thursday">&nbsp;</td>
    <td class="... Friday">&nbsp;</td>
    <td class="... Saturday">&nbsp;</td>
    </tr>

  This solves the problem:

--- planner-calendar.el-OLD     2005-07-24 17:25:18.000000000 +0200
+++ planner-calendar.el 2005-07-24 17:25:58.000000000 +0200
@@ -168,9 +168,10 @@
                      'nop))
 
         ;; add padding days at end of month to make rule lines neat
-        (planner-calendar-render i
-          (+ last blank-days) (+ last blank-days pad-days -1)
-          "td" "month-calendar-day-noday" "&nbsp;")
+        (unless (zerop (mod (+ blank-days last) 7))
+          (planner-calendar-render i
+            (+ last blank-days) (+ last blank-days pad-days -1)
+            "td" "month-calendar-day-noday" "&nbsp;"))
 
         "</tr>\n"
         "</tbody>\n"

  I didn't look why, but 'planner-calendar' is really, really
slow.  It's not normal for such a function.

  And I think the output could be simplified.  for example, here
is what is outputed for a day with no day page:

    <td class="month-calendar-day-nolink Monday">
      <span class="nonexistent">25</span>
    </td>

  Because the td.class is already 'month-calendar-day-nolink',
why add a span element with the @class='nonexistant'?  Is this
not enough:

    <td class="month-calendar-day-nolink Monday">25</td>

or even:

    <td class="no-day-page">25</td>

--drkm





reply via email to

[Prev in Thread] Current Thread [Next in Thread]