https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Modul%3AFormatDateTest Modul:FormatDateTest - Versionsgeschichte 2025-06-09T14:41:42Z Versionsgeschichte dieser Seite in Wikipedia MediaWiki 1.45.0-wmf.4 https://de.wikipedia.org/w/index.php?title=Modul:FormatDateTest&diff=139773495&oldid=prev Antonsusi: umbau Split 2015-03-14T15:29:26Z <p>umbau Split</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 14. März 2015, 17:29 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 25:</td> <td colspan="2" class="diff-lineno">Zeile 25:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> str = mw.ustring.sub(str,pos+1, -1);</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> str = mw.ustring.sub(str,pos+1, -1);</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> pos = mw.ustring.find(str,'-',1,true);</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> pos = mw.ustring.find(str,'-',1,true);</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not pos or pos == 0 then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not pos or pos == 0 then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;">return true, </del>Datum<del style="font-weight: bold; text-decoration: none;">;</del> <del style="font-weight: bold; text-decoration: none;">--</del> <del style="font-weight: bold; text-decoration: none;">Nur</del> <del style="font-weight: bold; text-decoration: none;">Jahr</del></div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> Datum<ins style="font-weight: bold; text-decoration: none;">.m</ins> <ins style="font-weight: bold; text-decoration: none;">=</ins> <ins style="font-weight: bold; text-decoration: none;">tonumber(str)</ins> <ins style="font-weight: bold; text-decoration: none;">or</ins> <ins style="font-weight: bold; text-decoration: none;">0</ins></div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker"><a class="mw-diff-movedpara-right" title="Der Absatz wurde verschoben. Klicken, um zur alten Stelle zu springen." href="#movedpara_8_1_lhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_4_0_rhs"></a> Datum.d = 0;</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker"><a class="mw-diff-movedpara-right" title="Der Absatz wurde verschoben. Klicken, um zur alten Stelle zu springen." href="#movedpara_8_2_lhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_4_1_rhs"></a> return true, Datum;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Teil = mw.ustring.sub(str,1,pos-1)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Teil = mw.ustring.sub(str,1,pos-1)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Datum.m = tonumber(Teil) or 0</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Datum.m = tonumber(Teil) or 0</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Teil = mw.ustring.sub(str,pos+1, -1)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Teil = mw.ustring.sub(str,pos+1, -1)</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> if #Teil == 0 then</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"><a class="mw-diff-movedpara-left" title="Der Absatz wurde verschoben. Klicken, um zur neuen Stelle zu springen." href="#movedpara_4_0_rhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_8_1_lhs"></a> Datum.d = 0;</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"><a class="mw-diff-movedpara-left" title="Der Absatz wurde verschoben. Klicken, um zur neuen Stelle zu springen." href="#movedpara_4_1_rhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_8_2_lhs"></a> return true, Datum;<del style="font-weight: bold; text-decoration: none;"> -- Nur Jahr und Monat</del></div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Datum.d = tonumber(Teil) or 0;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Datum.d = tonumber(Teil) or 0;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return true, Datum;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return true, Datum;</div></td> </tr> </table> Antonsusi https://de.wikipedia.org/w/index.php?title=Modul:FormatDateTest&diff=139771646&oldid=prev Antonsusi: +Kommentar 2015-03-14T14:24:02Z <p>+Kommentar</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 14. März 2015, 16:24 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 71:</td> <td colspan="2" class="diff-lineno">Zeile 71:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return true, Datum;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return true, Datum;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> if Datum.y % 4 == 0 then</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> if Datum.y % 4 == 0 then<ins style="font-weight: bold; text-decoration: none;"> -- Die greg. Sonderregeln werden ignoriert.</ins></div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if Datum.d &gt; 29 then -- nach Februar (Schaltjahr)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if Datum.d &gt; 29 then -- nach Februar (Schaltjahr)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Datum.m = 3;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Datum.m = 3;</div></td> </tr> </table> Antonsusi https://de.wikipedia.org/w/index.php?title=Modul:FormatDateTest&diff=139771281&oldid=prev Antonsusi: +Info 2015-03-14T14:13:13Z <p>+Info</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 14. März 2015, 16:13 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 1:</td> <td colspan="2" class="diff-lineno">Zeile 1:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local p = {}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local p = {}</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> -- ACHTUNG! Das Modul dient der Erprobung und ist nicht für den dauerhaften Einsatz vorgesehen!</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Trennen der Parameter</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Trennen der Parameter</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local function Split(str)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local function Split(str)</div></td> </tr> </table> Antonsusi https://de.wikipedia.org/w/index.php?title=Modul:FormatDateTest&diff=139771149&oldid=prev Antonsusi: AZ: Die Seite wurde neu angelegt: local p = {} -- Trennen der Parameter local function Split(str) local Datum = {} local Teil=""… 2015-03-14T14:09:05Z <p><a href="/wiki/Hilfe:Zusammenfassung_und_Quellen#Auto-Zusammenfassung" title="Hilfe:Zusammenfassung und Quellen">AZ</a>: Die Seite wurde neu angelegt: local p = {} -- Trennen der Parameter local function Split(str) local Datum = {} local Teil=&quot;&quot;…</p> <p><b>Neue Seite</b></p><div>local p = {}<br /> -- Trennen der Parameter<br /> local function Split(str)<br /> local Datum = {}<br /> local Teil=&quot;&quot;<br /> local pos = 0<br /> Datum.y = 0<br /> Datum.m = 0<br /> Datum.d = 0<br /> pos = mw.ustring.find(str,&#039;-&#039;,1,true);<br /> if pos == 1 then -- Minuszeichen am Anfang - nochmal suchen<br /> pos = mw.ustring.find(str,&#039;-&#039;,2,true);<br /> end<br /> if not pos then -- Bereits am Stringende<br /> Datum.y = tonumber(str);<br /> if Datum.y then<br /> return true, Datum -- Nur eine Jahreszahl<br /> else<br /> return false, Datum -- Kein Wert erkennbar<br /> end<br /> end<br /> Teil = mw.ustring.sub(str,1,pos-1);<br /> Datum.y = tonumber(Teil) or 0;<br /> str = mw.ustring.sub(str,pos+1, -1);<br /> pos = mw.ustring.find(str,&#039;-&#039;,1,true);<br /> if not pos or pos == 0 then<br /> return true, Datum; -- Nur Jahr<br /> end<br /> Teil = mw.ustring.sub(str,1,pos-1)<br /> Datum.m = tonumber(Teil) or 0<br /> Teil = mw.ustring.sub(str,pos+1, -1)<br /> if #Teil == 0 then<br /> Datum.d = 0;<br /> return true, Datum; -- Nur Jahr und Monat<br /> end<br /> Datum.d = tonumber(Teil) or 0;<br /> return true, Datum;<br /> end<br /> --<br /> <br /> local function CheckDate(Date)<br /> -- Monatspruefung<br /> if Date.m == 0 then -- keine Pruefung<br /> return true;<br /> end<br /> if Date.m &gt; 12 or Date.m &lt; 1 then<br /> return false;<br /> end<br /> if Date.d == 0 then -- nur Monat angegeben, keine Tagespruefung<br /> return true;<br /> end<br /> if ( Date.m == 4 or Date.m == 6 or Date.m == 9 or Date.m == 11) and Date.d &gt; 30 then<br /> return false;<br /> end<br /> if Date.m == 2 then -- Die greg. Sonderregeln werden ignoriert.<br /> if Date.y % 4 ~= 0 and Date.d &gt; 28 then return false; end<br /> if Date.y % 4 == 0 and Date.d &gt; 29 then return false; end<br /> end<br /> -- Hier nur noch 31-Tage-Monate übrig.<br /> if Date.d &gt; 31 then return false; end<br /> return true;<br /> end<br /> --<br /> local function TageInMonate(Datum)<br /> Datum.m = 1;<br /> if Datum.d &gt; 31 then -- nach Januar<br /> Datum.m = 2;<br /> Datum.d = Datum.d - 31;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.y % 4 == 0 then<br /> if Datum.d &gt; 29 then -- nach Februar (Schaltjahr)<br /> Datum.m = 3;<br /> Datum.d = Datum.d - 29;<br /> else<br /> return true, Datum;<br /> end<br /> else<br /> if Datum.d &gt; 28 then -- nach Februar (Normaljahr)<br /> Datum.m = 3;<br /> Datum.d = Datum.d - 28;<br /> else<br /> return true, Datum;<br /> end<br /> end<br /> if Datum.d &gt; 31 then -- nach Maerz<br /> Datum.m = 4;<br /> Datum.d = Datum.d - 31;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.d &gt; 30 then -- nach April<br /> Datum.m = 5;<br /> Datum.d = Datum.d - 30;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.d &gt; 31 then -- nach Mai<br /> Datum.m = 6;<br /> Datum.d = Datum.d - 31;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.d &gt; 30 then -- nach Juni<br /> Datum.m = 7;<br /> Datum.d = Datum.d - 30;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.d &gt; 31 then -- nach Juli<br /> Datum.m = 8;<br /> Datum.d = Datum.d - 31;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.d &gt; 31 then -- nach August<br /> Datum.m = 9;<br /> Datum.d = Datum.d - 31;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.d &gt; 30 then -- nach September<br /> Datum.m = 10;<br /> Datum.d = Datum.d - 30;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.d &gt; 31 then -- nach Oktober<br /> Datum.m = 11;<br /> Datum.d = Datum.d - 31;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.d &gt; 30 then -- nach November<br /> Datum.m = 12;<br /> Datum.d = Datum.d - 30;<br /> else<br /> return true, Datum;<br /> end<br /> if Datum.d &gt; 31 then -- nach Dezember = Fehler<br /> Datum.m = 0;<br /> Datum.d = 0;<br /> return false, Datum;<br /> else<br /> return true, Datum;<br /> end<br /> end<br /> --<br /> <br /> local function Run(Args)<br /> local T_L = {&quot;Januar&quot;,&quot;Februar&quot;, &quot;März&quot;, &quot;April&quot;, &quot;Mai&quot;,&quot;Juni&quot;, &quot;Juli&quot;, &quot;August&quot;,&quot;September&quot;,&quot;Oktober&quot;,&quot;November&quot;,&quot;Dezember&quot;,&quot;Jänner&quot;}<br /> local T_M = {&quot;Jan.&quot;,&quot;Feb.&quot;, &quot;März&quot;, &quot;Apr.&quot;, &quot;Mai&quot;,&quot;Juni&quot;, &quot;Juli&quot;, &quot;Aug.&quot;,&quot;Sep.&quot;,&quot;Okt.&quot;,&quot;Nov.&quot;,&quot;Dez.&quot;,&quot;Jän.&quot;}<br /> local T_S = {&quot;Jan.&quot;,&quot;Feb.&quot;, &quot;Mrz.&quot;, &quot;Apr.&quot;, &quot;Mai&quot;,&quot;Jun.&quot;, &quot;Jul.&quot;, &quot;Aug.&quot;,&quot;Sep.&quot;,&quot;Okt.&quot;,&quot;Nov.&quot;,&quot;Dez.&quot;,&quot;Jän.&quot;}<br /> local Text = &quot;&quot;;<br /> local TextYear = &quot;&quot;;<br /> local TextMonth = &quot;&quot;;<br /> local TextDay = &quot;&quot;;<br /> local idxm = 0 ; -- Wegen der AT-Regel ein Extraindex fuer den Monat.<br /> local AT = false;<br /> local NBSP = false;<br /> local LINK = false;<br /> local VCHR = &quot;&quot;;<br /> local STIL = &#039;L&#039;;<br /> local IsOk = true;<br /> local Tbl = {}<br /> local SortIt = false;<br /> local Zero = false;<br /> local Numstr = &quot;&quot;;<br /> local SortTag= &quot;&quot;;<br /> local Arg2 = mw.ustring.lower(mw.text.trim(Args[2] or &quot;&quot;));<br /> local Arg3 = mw.ustring.lower(mw.text.trim(Args[3] or &quot;&quot;));<br /> local Arg4 = mw.ustring.lower(mw.text.trim(Args[4] or &quot;&quot;));<br /> local davor = mw.text.trim(Args[&#039;davor&#039;] or &quot;&quot;);<br /> if Arg2 == &quot;nbsp&quot; or Arg3 == &quot;nbsp&quot; or Arg4 == &quot;nbsp&quot; then NBSP = true; end<br /> if Arg2 == &quot;link&quot; or Arg3 == &quot;link&quot; or Arg4 == &quot;link&quot; then LINK = true; end<br /> if Arg2 == &quot;l&quot; or Arg3 == &quot;l&quot; or Arg4 == &quot;l&quot; then STIL = &#039;L&#039;; end<br /> if Arg2 == &quot;m&quot; or Arg3 == &quot;m&quot; or Arg4 == &quot;m&quot; then STIL = &#039;M&#039;; end<br /> if Arg2 == &quot;s&quot; or Arg3 == &quot;s&quot; or Arg4 == &quot;s&quot; then STIL = &#039;S&#039;; end<br /> if mw.ustring.lower(mw.text.trim(Args[&#039;AT&#039;] or &quot;&quot;)) == &quot;ja&quot; then AT = true; end<br /> if mw.ustring.lower(mw.text.trim(Args[&#039;Zero&#039;] or &quot;&quot;)) ~= &quot;&quot; then Zero = true; end<br /> if mw.ustring.lower(mw.text.trim(Args[&#039;Sort&#039;] or &quot;&quot;)) ~= &quot;&quot; then SortIt = true; Zero = true; end<br /> if davor ~=&quot;&quot; then davor = davor .. &quot;&amp;nbsp;&quot;; end<br /> IsOk, Tbl = Split(Args[1])<br /> if not IsOk then<br /> Text = &#039;&lt;span class=&quot;error&quot;&gt;[[Vorlage:FormatDate]]: Kein gültiges ISO-Datum!&lt;/span&gt;&#039;<br /> return Text<br /> end<br /> --Tage ohne Monat: Tage in Monat und Tag umrechnen<br /> if Tbl.m == 0 and Tbl.d ~= 0 then<br /> IsOk, Tbl = TageInMonate(Tbl)<br /> end<br /> if not IsOk then<br /> Text = &#039;&lt;span class=&quot;error&quot;&gt;[[Vorlage:FormatDate]]: Kein gültiges ISO-Datum!&lt;/span&gt;&#039;<br /> return Text<br /> end<br /> Tbl.y = tonumber(Tbl.y) or 0;<br /> if Tbl.y == 0 and Tbl.m == 0 and Tbl.d == 0 then<br /> Text = &#039;&lt;span class=&quot;error&quot;&gt;[[Vorlage:FormatDate]]: Ungültiger Wert (&quot;0-0-0&quot;) für das Datum! &lt;/span&gt;&#039;<br /> return Text<br /> end<br /> if Tbl.y &lt; 0 then -- Jahr Null reserviert fuer &quot;Nur Tag und Monat&quot;<br /> Tbl.y = 0 - Tbl.y<br /> VCHR = &#039; v. Chr.&#039;;<br /> end<br /> <br /> IsOk = CheckDate(Tbl);<br /> if not IsOk then<br /> Text = &#039;&lt;span class=&quot;error&quot;&gt;[[Vorlage:FormatDate]]: Ungültiges Datum!&#039;.. table.concat(Tbl,&#039;.&#039;)..&#039;&lt;/span&gt;&#039;<br /> return Text<br /> end<br /> <br /> if Tbl.d &gt; 0 then -- Tag angegeben, String erstellen<br /> TextDay = tostring(Tbl.d) .. &#039;.&amp;nbsp;&#039;<br /> if Tbl.d &lt; 10 and Zero then<br /> TextDay = &#039;&lt;span style=&quot;visibility:hidden;&quot;&gt;0&lt;/span&gt;&#039; .. TextDay;<br /> end<br /> else<br /> TextDay = &#039;&#039;;<br /> end<br /> <br /> if Tbl.m &gt; 0 then -- Monat angegeben, String erstellen<br /> if AT and Tbl.m == 1 then<br /> idxm = 13<br /> else<br /> idxm = Tbl.m;<br /> end<br /> <br /> if STIL == &#039;S&#039; then<br /> TextMonth = T_S[idxm] ;<br /> elseif STIL == &#039;M&#039; then<br /> TextMonth = T_M[idxm] ;<br /> else<br /> TextMonth = T_L[idxm] ;<br /> end<br /> <br /> Text = TextDay .. TextMonth<br /> if LINK then<br /> if Tbl.d == 0 then<br /> Linkziel =T_L[Tbl.m]<br /> else<br /> Linkziel = tostring(Tbl.d) .. &quot;. &quot; .. T_L[Tbl.m]<br /> end<br /> Text = &#039;[[&#039; .. Linkziel .. &#039;|&#039; .. Text .. &#039;]]&#039;;<br /> end<br /> end<br /> -- hier Tag und Monat zusammen, evtl. verlinkt<br /> <br /> if Tbl.y ~= 0 then<br /> if LINK then<br /> TextYear = &#039;[[&#039; .. tostring(Tbl.y) .. VCHR .. &#039;]]&#039;;<br /> else<br /> TextYear = tostring(Tbl.y) .. VCHR;<br /> end<br /> if Tbl.m &gt; 0 then<br /> if NBSP then<br /> TextYear = &#039;&amp;nbsp;&#039; .. TextYear;<br /> else<br /> TextYear = &#039; &#039; .. TextYear;<br /> end<br /> end<br /> end<br /> Text = Text .. TextYear;<br /> <br /> if SortIt then<br /> if VCHR ~= &quot;&quot; then<br /> Tbl.y = 0 - Tbl.y<br /> end<br /> Numstr = string.format(&#039;%d%2.2d%2.2d&#039;,5000+Tbl.y,Tbl.m,Tbl.d);<br /> SortTag=&#039;&lt;span style=&quot;display:none&quot; class=&quot;sortkey&quot;&gt;&#039; .. Numstr .. &#039;&lt;/span&gt;&#039;;<br /> Text = SortTag .. davor .. Text;<br /> end<br /> return Text<br /> end<br /> --<br /> <br /> function p.Execute(frame)<br /> local FR = frame:getParent()<br /> return Run(FR.args)<br /> end<br /> <br /> function p.Sort(frame)<br /> local FR = frame:getParent()<br /> FR.args.Sort=&#039;1&#039;<br /> return Run(FR.args)<br /> end<br /> return p</div> Antonsusi