Vorlage:Wochentag
Aus Kitakien
(Unterschied zwischen Versionen)
(einleitung, kat) |
(kommentare hinzugefügt) |
||
Zeile 11: | Zeile 11: | ||
</noinclude><!-- | </noinclude><!-- | ||
- | + | Parameter: {{{1}}} Tag; {{{2}}} Monat; {{{3}}} Jahr. | |
--> | --> | ||
- | {{#switch: {{#expr: ({{#switch:{{CURRENTMONTH}} | + | {{#switch: |
- | |01 = 0 | + | |
- | |02 = 31 <!--Tage bis 1. Februar--> | + | {{#expr: ( {{#switch:{{CURRENTMONTH}} <!--Berechnung der Differenz von heutigem Datum und gefragtem Datum in Tagen--> |
- | |03 = 59 <!--Tage bis 1. März--> | + | |01 = 0 |
- | |04 = 90 <!--usw.--> | + | |02 = 31 <!--Tage bis 1. Februar--> |
- | |05 = 120 | + | |03 = 59 <!--Tage bis 1. März--> |
- | |06 = 151 | + | |04 = 90 <!--usw.--> |
- | |07 = 181 | + | |05 = 120 |
- | |08 = 212 | + | |06 = 151 |
- | |09 = 243 | + | |07 = 181 |
- | |10 = 273 | + | |08 = 212 |
- | |11 = 304 | + | |09 = 243 |
- | |12 = 334 | + | |10 = 273 |
- | }} + {{CURRENTDAY}} | + | |11 = 304 |
+ | |12 = 334 | ||
+ | }} | ||
+ | + {{CURRENTDAY}} | ||
+ {{CURRENTYEAR}} - {{{3}}} | + {{CURRENTYEAR}} - {{{3}}} | ||
- | + ({{CURRENTYEAR}}-{{CURRENTYEAR}}mod4-{{{3}}}+{{{3}}}mod4)/4 | + | + ({{CURRENTYEAR}}-{{CURRENTYEAR}}mod4-{{{3}}}+{{{3}}}mod4)/4 <!--Hinzufügen von Schalttagen--> |
- ({{CURRENTYEAR}}-{{CURRENTYEAR}}mod100-{{{3}}}+{{{3}}}mod100)/100 | - ({{CURRENTYEAR}}-{{CURRENTYEAR}}mod100-{{{3}}}+{{{3}}}mod100)/100 | ||
+ ({{CURRENTYEAR}}-{{CURRENTYEAR}}mod400-{{{3}}}+{{{3}}}mod400)/400 | + ({{CURRENTYEAR}}-{{CURRENTYEAR}}mod400-{{{3}}}+{{{3}}}mod400)/400 | ||
- | + {{#ifexpr: {{{3}}}mod4=0 and {{{2}}}<=2 |1 |0 }} | + | + {{#ifexpr: {{{3}}}mod4=0 and {{{2}}}<=2 |1 |0 }} <!--Korrektur (evtl. ist ein Schalttag zu viel berechnet worden)--> |
- {{#ifexpr: {{{3}}}mod100=0 and {{{2}}}<=2 |1 |0 }} | - {{#ifexpr: {{{3}}}mod100=0 and {{{2}}}<=2 |1 |0 }} | ||
+ {{#ifexpr: {{{3}}}mod400=0 and {{{2}}}<=2 |1 |0 }} | + {{#ifexpr: {{{3}}}mod400=0 and {{{2}}}<=2 |1 |0 }} | ||
+ 364 - {{#switch: {{{2}}} | + 364 - {{#switch: {{{2}}} | ||
- | |01 = 0 | + | |01 = 0 |
- | |02 = 31 | + | |02 = 31 <!--Tage bis 1. Februar--> |
- | |03 = 59 | + | |03 = 59 <!--Tage bis 1. März--> |
- | |04 = 90 | + | |04 = 90 <!--usw.--> |
- | |05 = 120 | + | |05 = 120 |
- | |06 = 151 | + | |06 = 151 |
- | |07 = 181 | + | |07 = 181 |
- | |08 = 212 | + | |08 = 212 |
- | |09 = 243 | + | |09 = 243 |
- | |10 = 273 | + | |10 = 273 |
- | |11 = 304 | + | |11 = 304 |
- | |12 = 334 | + | |12 = 334 |
- | }} - {{{1}}}) mod 7 }} | + | }} |
+ | - {{{1}}}) mod 7 }} <!--Differenz Rest 7 ergibt den Wochentag--> | ||
+ | |||
|0 = {{CURRENTDOW}} | |0 = {{CURRENTDOW}} | ||
|1 = {{#ifexpr: {{CURRENTDOW}}>=1 |{{#expr:{{CURRENTDOW}}-1}} |{{#expr:{{CURRENTDOW}}+6}} }} | |1 = {{#ifexpr: {{CURRENTDOW}}>=1 |{{#expr:{{CURRENTDOW}}-1}} |{{#expr:{{CURRENTDOW}}+6}} }} |
Version vom 19:57, 14. Jul. 2006
Eingabe:
{{Wochentag|1|1|1970}}
(Tag|Monat|Jahr)
Ausgabe:
0 (Sonntag), 1 (Montag), 2 (Dienstag), 3 (Mittwoch), 4 (Donnerstag), 5 (Freitag), 6 (Samstag)