Template talk:Date from ordinal

Latest comment: 18 years ago by Ed Poor in topic Discussion

Examples

{{date from ordinal|13}} is 13 January, should be January 13

{{date from ordinal|43}} is 12 February, should be February 12

{{date from ordinal|75}} is 16 March, should be March 16

{{date from ordinal|75|leapyear=1}} is 15 March, should be March 15

{{date from ordinal|75|1999}} is 16 March, should be March 16

{{date from ordinal|75|2000}} is 15 March, should be March 15

Discussion

The template could be speeded up and/or shortened by using arithmetic and if-then constructs. I have something in mind like:

if x <= 31 return xif x <= 59 // 31 + 28 return x - 31if x <= 90 // 31 + 28 + 31 return x - 59// etc.

The numbers 31, 28, 31 etc. are the lengths of each month in non-leap years. --Uncle Ed 16:04, 21 April 2006 (UTC)

Separate day from month

{{

 JULIANDAY.DAY |Expression error: Unrecognized punctuation character "{".