Skip to content

Commit

Permalink
browser build
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed May 31, 2015
1 parent 91961a8 commit 3fdee92
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions build/ical.js
Original file line number Diff line number Diff line change
Expand Up @@ -4821,6 +4821,17 @@ ICAL.TimezoneService = (function() {
return this.dayOfYear() - delta;
},

/**
* Get the dominical letter for the current year. Letters range from A - G
* for common years, and AG to GF for leap years.
*
* @param {Number} yr The year to retrieve the letter for
* @return {String} The dominical letter.
*/
getDominicalLetter: function() {
return ICAL.Time.getDominicalLetter(this.year);
},

/**
* Finds the nthWeekDay relative to the current month (not day). The
* returned value is a day relative the month that this month belongs to so
Expand Down Expand Up @@ -5629,6 +5640,24 @@ ICAL.TimezoneService = (function() {
return t;
};

/**
* Get the dominical letter for the given year. Letters range from A - G for
* common years, and AG to GF for leap years.
*
* @param {Number} yr The year to retrieve the letter for
* @return {String} The dominical letter.
*/
ICAL.Time.getDominicalLetter = function(yr) {
var LTRS = "GFEDCBA";
var dom = (yr + (yr / 4 | 0) + (yr / 400 | 0) - (yr / 100 | 0) - 1) % 7;
var isLeap = ICAL.Time.isLeapYear(yr);
if (isLeap) {
return LTRS[(dom + 6) % 7] + LTRS[dom];
} else {
return LTRS[dom];
}
};

/**
* January 1st, 1970 as an ICAL.Time.
* @type {ICAL.Time}
Expand Down

0 comments on commit 3fdee92

Please sign in to comment.