Skip to content

weeks

Imported from yugajs/extension/weeks.

const weeks: yuga.Extension<undefined>;

Week getters and setters from Day.js’s weekday, isoWeek, weekYear and isoWeeksInYear plugins, and the week format tokens of its weekOfYear and isoWeek plugins: w and ww (the locale’s week, Moment.js’s w, also parsed with custom-parse-format) and W and WW (the ISO week, week()). yugajs/extension/weeks.


const weekYear: (instance, weekStart, yearStart) => number;

The year the week of an instance belongs to, for weeks starting on weekStart (0 is Sunday) whose first week of the year has at least yearStart days in it (the same arguments as core.$.weekOfYear, ISO weeks are 1 and 4). NaN when invalid.

Derived from the week number, so the week and its year can’t disagree: the first week of January that is numbered 52 or 53 belongs to the previous year, and week 1 in December to the next.

Parameter Type
instance Instance
weekStart number
yearStart number

number