build/ical.js
function startDoyWeek(aFirstDayOfWeek) {
      var firstDow = aFirstDayOfWeek || ICAL.Time.SUNDAY;
      var delta = this.dayOfWeek() - firstDow;
      if (delta < 0) delta += 7;
      return this.dayOfYear() - delta;
    }
function startDoyWeek(aFirstDayOfWeek) {
      var firstDow = aFirstDayOfWeek || ICAL.Time.SUNDAY;
      var delta = this.dayOfWeek() - firstDow;
      if (delta < 0) delta += 7;
      return this.dayOfYear() - delta;
    }
function startDoyWeek ( aFirstDayOfWeek ) { var firstDow = aFirstDayOfWeek || ICAL . Time . SUNDAY ; var delta = this . dayOfWeek ( ) - firstDow ; if ( delta < 0 ) delta += 7 ; return this . dayOfYear ( ) - delta ; }
First calculates the start of the week, then returns the day of year for
this date. If the day falls into the previous year, the day is zero or negative.

@param {ICAL.Time.weekDay=} aFirstDayOfWeek
The week start weekday, defaults to SUNDAY
@return {Number}     The calculated day of year
First calculates the start of the week then returns the day of year for this date . If the day falls into the previous year the day is zero or negative .