Jump to content

Template:Daycap/doc

From Calamity Wiki
Revision as of 03:33, 14 February 2026 by imported>Peterwhy (→Examples: Day with single digit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Returns the day of the month after one month, capped by the number of days in the next month. The result is not zero-padded by default.

Usage

{{daycap|monthname|day|year}}. The default values are from the current date.

Examples

  • {{daycap}} → 29
  • {{daycap|2=5}} (from current month) → 5 (from current month)
  • {{daycap|2=31}} (from potentially invalid day) → 31 (from potentially invalid day)
  • {{daycap|January|29|2025}} → 28
  • {{daycap|January|30}} → 28
  • {{daycap|January|30|2024}} → 29
  • {{daycap|January|30|2025}} → 28
  • {{daycap|January|31}} → 28
  • {{daycap|January|31|2024}} → 29
  • {{daycap|January|31|2025}} → 28
  • {{daycap|February}} (from potentially invalid day) → 29 (from potentially invalid day)
  • {{daycap|February|30}} (from invalid date) → 30 (from invalid date)
  • {{daycap|April|20}} → 20
  • {{daycap|June|1}} → 1
  • {{daycap|October|31}} → 30
  • {{daycap|December|31|2026}} → 31