Skip to content

Commit

Permalink
tweaked some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
floydpink committed Sep 17, 2015
1 parent 1ac36a6 commit e86f718
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/calculations.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@ class Calculations {

calendarData.adhimasa = Calendar.getAdhimasa(lastConjunctionLongitude, nextConjunctionLongitude);
calendarData.masaNum = Calendar.getMasaNum(trueSolarLongitude, lastConjunctionLongitude);
// TODO: Move the below function to within KollavarshamDate class
// TODO: Move below to within KollavarshamDate class
calendarData.masa = Calendar.getMasaName(calendarData.masaNum).saka;

const sauraMasaMonthDay = this.calendar.getSauraMasaMonthDay(ahargana, desantara);
const sauraMasaNum = sauraMasaMonthDay.month;
const sauraMasaDay = sauraMasaMonthDay.day;
// TODO: Move the below function to within KollavarshamDate class
// TODO: Move below to within KollavarshamDate class
calendarData.sauraMasa = Calendar.getMasaName(sauraMasaNum).saura;

calendarData.malayalaMasaNum = (sauraMasaNum - 4 + 12 ) % 12;
// TODO: Move the below function to within KollavarshamDate class
// TODO: Move below to within KollavarshamDate class
const malayalaMasa = Calendar.getMasaName(calendarData.malayalaMasaNum);
calendarData.malayalaMasa = malayalaMasa.enMalayalam;
calendarData.mlMalayalaMasa = malayalaMasa.mlMalayalam;
Expand Down
6 changes: 3 additions & 3 deletions lib/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Calendar {
}

nextDate(date) {
// TODO: This looks like a concern of the calling library - But could be exposed as a static utility function (0 usages other than tests)
// TODO: This looks like a concern of the calling library - But could be exposed as a static utility method (0 usages other than tests)
date.setUTCDate(date.getUTCDate() + 1);
return date;
}
Expand Down Expand Up @@ -140,13 +140,13 @@ class Calendar {
}

julianInEngland(julianDay) {
// TODO: This might be exposed as a static utility function (0 usages other than tests)
// TODO: This might be exposed as a static utility method (0 usages other than tests)
// Gregorian calendar was first introduced in most of Europe in 1582,
// but it wasn't adopted in England (and so in US and Canada) until 1752
//
// - http://www.timeanddate.com/calendar/julian-gregorian-switch.html
//
// This function returns true between
// This returns true between
// October 14th, 1582 and September 14th, 1752, both dates exclusive
return julianDay >= 2299160 && julianDay <= 2361221;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class Kollavarsham {
* @throws {Error} When the API is implemented, will convert <date>
*/
toGregorianDate(date) {
//TODO: Implement this function
//TODO: Implement this method
throw new Error(util.format('When the API is implemented, will convert %s', date));
}

Expand Down
2 changes: 2 additions & 0 deletions lib/mathHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const _epsilon = 1e-8; // eslint-disable-line no-underscore-dangle
const _radianInDegrees = 180 / Math.PI; // eslint-disable-line no-underscore-dangle

class MathHelper {

static get epsilon() {
return _epsilon;
}
Expand Down Expand Up @@ -73,6 +74,7 @@ class MathHelper {
const result = angleInDegrees - MathHelper.truncate(angleInDegrees / 360) * 360;
return result < 0 ? 360 + result : result;
}

}

export default MathHelper;

0 comments on commit e86f718

Please sign in to comment.