From da01fdc2d75dd32b7736dc79c653504189cb9575 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <thorsten.glaser@teckids.org>
Date: Sun, 8 Jan 2017 00:47:54 +0100
Subject: [PATCH] =?UTF-8?q?[verein.git]=20render=20the=20year=20line=20(wo?=
 =?UTF-8?q?ah=E2=80=A6)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 teckidscaltmp.sty | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/teckidscaltmp.sty b/teckidscaltmp.sty
index 5f3cf25..e9c2693 100644
--- a/teckidscaltmp.sty
+++ b/teckidscaltmp.sty
@@ -92,6 +92,7 @@
 \gdef\tkFNtext{}%	Fußnotentext
 
 \newcount\tkCalNumMon%	Anzahl Monate (= Spalten / 3)
+\newcount\tkCalNumYr%	Jahrescolspantracker
 
 \newtoks\tkCalToks%	temporary token
 \newtoks\tkCalLineY%	current year's line
@@ -338,12 +339,17 @@
  \tkCalToks=\expandafter{\the\expandafter\tkCalToks #1}%
 }%
 
+\newcommand{\tkAddTokp}[1]{%
+ \tkCalToks=\expandafter{\the\expandafter\tkCalToks \expandafter{#1}}%
+}%
+
 \newcommand{\tkAmdToks}[1]{%
  \tkCalToks=\expandafter{\the\tkCalToks #1}%
 }%
 
 \newcommand{\teckidscalrender}[1]{%
- \tkCalNumMon=0%
+ \tkCalNumYr=\z@%
+ \tkCalNumMon=\z@%
  \tkCalLineY={}%
  \csname tkCalLine0\endcsname={}%
  \csname tkCalLine1\endcsname={}%
@@ -385,7 +391,14 @@
   \tkFromJD{\tkjd}%
   \ifnum\@tempcnta=\tktmY\else%
    \ifnum\@tempcnta=\z@\else%
-    % TODO: add colspan to tkCalLineY
+    \tkCalToks={}%
+    \tkAmdToks{\multicolumn}%
+    \tkAddTokp{\number\tkCalNumYr}%
+    \tkAmdToks{{|c|}}%
+    \tkAddTokp{\number\@tempcnta}%
+    \tkAmdToks{\tkCalColsep}%
+    \tkCalLineY=\expandafter{\the\expandafter\tkCalLineY \the\tkCalToks}%
+    \tkCalNumYr=0%
    \fi%
    \@tempcnta=\tktmY%
   \fi%
@@ -399,6 +412,7 @@
    \csname tkCalLine0\endcsname=\expandafter{\the\expandafter\expandafter\csname tkCalLine0\endcsname \the\tkCalToks}%
    \@tempcntb=\tktmM%
    \advance\tkCalNumMon by 1%
+   \advance\tkCalNumYr by 3%
   \fi%
   %
   \tkCalToks={}%
@@ -439,9 +453,16 @@
  \ifnum\tkjd < \tkcalend%
   \advance\tkjd by 1%
  \repeat%
+ %
+ \tkCalToks={}%
+ \tkAmdToks{\multicolumn}%
+ \tkAddTokp{\number\tkCalNumYr}%
+ \tkAmdToks{{|c|}}%
+ \tkAddTokp{\number\@tempcnta}%
+ \tkCalLineY=\expandafter{\the\expandafter\tkCalLineY \the\tkCalToks}%
 
  \begin{tabu} to \linewidth {|*{\the\tkCalNumMon}{rlX|}}
-  \multicolumn{15}{|c|}{2016} & \multicolumn{24}{|c|}{2017} \\\hline
+  \the\tkCalLineY\\\hline
   \the\csname tkCalLine0\endcsname\\\hline
   \the\csname tkCalLine1\endcsname\\\hline
   \the\csname tkCalLine2\endcsname\\\hline
-- 
GitLab