public/javascripts/yui/calendar/calendar.js
function(date, calendarYear) {
        var beginYear = this.getJan1(calendarYear); // Find the start of the year. This will be in week 1.
        
        // Find the number of days the passed in date is away from the calendar year start
        var dayOffset = Math.ceil((date.getTime()-beginYear.getTime()) / this.ONE_DAY_MS);
        return dayOffset;
    }
function(date, calendarYear) {
        var beginYear = this.getJan1(calendarYear); // Find the start of the year. This will be in week 1.
        
        // Find the number of days the passed in date is away from the calendar year start
        var dayOffset = Math.ceil((date.getTime()-beginYear.getTime()) / this.ONE_DAY_MS);
        return dayOffset;
    }
function ( date , calendarYear ) { var beginYear = this . getJan1 ( calendarYear ) ; // Find the start of the year. This will be in week 1. // Find the number of days the passed in date is away from the calendar year start var dayOffset = Math . ceil ( ( date . getTime ( ) - beginYear . getTime ( ) ) / this . ONE_DAY_MS ) ; return dayOffset ; }
Calculates the number of days the specified date is from January 1 of the specified calendar year.
Passing January 1 to this function would return an offset value of zero.
@method getDayOffset
@param {Date} date The JavaScript date for which to find the offset
@param {Number} calendarYear The calendar year to use for determining the offset
@return {Number} The number of days since January 1 of the given year
Calculates the number of days the specified date is from January 1 of the specified calendar year . Passing January 1 to this function would return an offset value of zero .