Template talk:First sunday in april

From Wikipedia, the free encyclopedia

Can we make this template perpetual?

  • current month name: June
  • current month number: 6
  • first day of current month: June 1
  • first day of current month (ordinal): 152
  • The Sunday which comes on or before the first day of the current month: 147

{{ordinal date}} = 165

{{User:Ed Poor/date from serial|{{ordinal date}}}} = June 14

{{User:Ed Poor/date serial|4|1}} = 91 = April 1

{{minus|{{ordinal date}}|{{CURRENTDOW}}}} = 160

{{CURRENTDOW}} = 5

{{subtract|91|{{CURRENTDOW}}}} = 86

Sunday of the current week: {{user:Ed Poor/date from serial|87}} = March 28

If "Sunday of the current week" is in the current month, good! Otherwise, add 7 days to it.

March ? March 28 : April 4

April 4

Oh, forget it! --Uncle Ed 02:44, 17 March 2006 (UTC)

[edit] Perpetual formula

There's a formula based on (5 * year) mod 7 that does it. I made a few templates already:

You just have tweak the formula a bit. --Uncle Ed 16:15, 24 April 2006 (UTC)