RW constructor.

Usage:

obj = rw(year, fullWeeks)

obj = rw(dateString)

obj = rw(datenumber)

Inputs:

  • year: Year of the date.

  • fullWeeks: Week of the year, from 1 to 52 or 53. A week runs from Sunday to Saturday and a weekly date is the Saturday that closes its week. Week 1 is the week of January 1st and the label of a week is the year of its Saturday followed by its rank in that year: rw(2021,1) is the week ending Saturday January 2, 2021, labeled 2021W01. A week number beyond the last week of the year is clamped to the last week, with a warning.

  • dateString: A string in the format ‘mm/dd/yyyy’ or ‘yyyyWp’ or ‘yyyy-mm-dd’.

Example:

dateObj = rw(2023, 10);

dateObj = rw(‘07/01/2023’);

dateObj = rw(‘1990W1’);

dateObj = rw(737999);

See also rd, rm, rq, rh, ra, ry