Skip to content

Commit

Permalink
fixed some typos and accepted some spellings
Browse files Browse the repository at this point in the history
  • Loading branch information
floydpink committed Sep 17, 2015
1 parent 03b2e46 commit 99fe821
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 63 deletions.
89 changes: 89 additions & 0 deletions .idea/dictionaries/hari.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions lib/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ class Calendar {

const adhiMasas = MathHelper.truncate(sauraMasas * this.celestial.yuga.Adhimasa / ( 12 * this.celestial.planets.sun.YugaRotation )); // expired adhimasas

const candaMasas = sauraMasas + adhiMasas; // expired candra masas
const candraMasas = sauraMasas + adhiMasas; // expired candra masas

const tithis = 30 * candaMasas + tithiDay - 1; // expired tithis
const tithis = 30 * candraMasas + tithiDay - 1; // expired tithis

const avamas = MathHelper.truncate(tithis * this.celestial.yuga.Ksayadina / this.celestial.yuga.Tithi); // expired avamas

Expand All @@ -236,9 +236,9 @@ class Calendar {
return MathHelper.floatingPointEqual(n1, n2, false) ? 'Adhika-' : '';
}

static getMasaNum(tslong, clong) {
let masaNum = MathHelper.truncate(tslong / 30) % 12;
if (masaNum === MathHelper.truncate(clong / 30) % 12) {
static getMasaNum(trueSolarLongitude, lastConjunctionLongitude) {
let masaNum = MathHelper.truncate(trueSolarLongitude / 30) % 12;
if (masaNum === MathHelper.truncate(lastConjunctionLongitude / 30) % 12) {
masaNum += 1;
}
masaNum = (masaNum + 12) % 12;
Expand Down Expand Up @@ -325,8 +325,8 @@ class Calendar {
return {month : month, day : day};
}

static getNaksatra(tllong) {
return Calendar.naksatras[MathHelper.truncate(tllong * 27 / 360)];
static getNaksatra(trueLunarLongitude) {
return Calendar.naksatras[MathHelper.truncate(trueLunarLongitude * 27 / 360)];
}

}
Expand Down
4 changes: 2 additions & 2 deletions test/lib/calendar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ describe('Calendar', function () {
outputformat : 'verbose'
};

function cmpDates(date1, date2) {
const cmpDates = function (date1, date2) {
return date1.getFullYear() === date2.getFullYear() &&
date1.getMonth() === date2.getMonth() &&
date1.getDate() === date2.getDate();
}
};

beforeEach(function () {
calendar = new Calendar(settings);
Expand Down
6 changes: 3 additions & 3 deletions test/lib/celestial/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('Celestial', function () {

});

describe('getTllong', function () {
describe('getTrueLunarLongitude', function () {

it('should return correct results', function () {

Expand All @@ -139,7 +139,7 @@ describe('Celestial', function () {

});

describe('getTslong', function () {
describe('getTrueSolarLongitude', function () {

it('should return correct results', function () {

Expand Down Expand Up @@ -271,7 +271,7 @@ describe('Celestial', function () {

});

describe('getElong', function () {
describe('getEclipticLongitude', function () {

it('should return correct results', function () {

Expand Down
9 changes: 0 additions & 9 deletions test/lib/celestial/planetarySystem/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('PlanetarySystem', function () {
});

it('should set the YugaRotation values correctly', function () {

expect(planets.star.YugaRotation).to.equal(1582237800);
expect(planets.sun.YugaRotation).to.equal(4320000);
expect(planets.moon.YugaRotation).to.equal(57753336);
Expand All @@ -28,21 +27,18 @@ describe('PlanetarySystem', function () {
expect(planets.saturn.YugaRotation).to.equal(146564);
expect(planets.candrocca.YugaRotation).to.equal(488219);
expect(planets.rahu.YugaRotation).to.equal(-232226);

});

});

describe('constructor with system as SuryaSiddhanta', function () {

beforeEach(function () {
planetarySystem = new PlanetarySystem('SuryaSiddhanta');
planets = planetarySystem.planets;
yuga = planetarySystem.yuga;
});

it('should set up the planetary constants correctly', function () {

expect(planets.star.YugaRotation).to.equal(1582237800);
expect(planets.sun.YugaRotation).to.equal(4320000);
expect(planets.moon.YugaRotation).to.equal(57753336);
Expand Down Expand Up @@ -114,21 +110,17 @@ describe('PlanetarySystem', function () {
expect(yuga.Adhimasa).to.equal(1593336);
expect(yuga.Tithi).to.equal(1603000080);
expect(yuga.Ksayadina).to.equal(25082280);

});

});

describe('constructor with system as InPancasiddhantika', function () {

beforeEach(function () {
planetarySystem = new PlanetarySystem('InPancasiddhantika');
planets = planetarySystem.planets;
yuga = planetarySystem.yuga;
});

it('should set up the planetary constants correctly', function () {

expect(planets.star.YugaRotation).to.equal(1582237828);
expect(planets.sun.YugaRotation).to.equal(4320000);
expect(planets.moon.YugaRotation).to.equal(57753336);
Expand Down Expand Up @@ -200,7 +192,6 @@ describe('PlanetarySystem', function () {
expect(yuga.Adhimasa).to.equal(1593336);
expect(yuga.Tithi).to.equal(1603000080);
expect(yuga.Ksayadina).to.equal(25082252);

});

});
Expand Down
15 changes: 0 additions & 15 deletions test/lib/dates/julianDate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,36 @@ describe('JulianDate', function () {
let julianDate;

beforeEach(function () {

julianDate = new JulianDate(2013, 12, 31); // Not perhaps a valid Julian Date

});

describe('constructor', function () {

it('should set up the date correctly', function () {

expect(julianDate.year).to.equal(2013);
expect(julianDate.month).to.equal(12);
expect(julianDate.day).to.equal(31);

});

});

describe('toString', function () {

it('should return the correct value', function () {

expect(julianDate.toString()).to.equal('2013 12 31');
expect(new JulianDate(1, 1, 1).toString()).to.equal('0001 01 01');

});

});

describe('empty constructor', function () {

beforeEach(function () {

julianDate = new JulianDate();

});

it('should set up the date correctly', function () {

expect(julianDate.year).to.equal(1);
expect(julianDate.month).to.equal(1);
expect(julianDate.day).to.equal(1);
expect(julianDate.toString()).to.equal('0001 01 01');

});

});

});
8 changes: 0 additions & 8 deletions test/lib/dates/kollavarshamDate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,17 @@ describe('KollavarshamDate', function () {
});

describe('empty constructor', function () {

it('should set up the date correctly', function () {

expect(date.day).to.equal(1);
expect(date.month).to.equal(1);
expect(date.year).to.equal(1);

});

});

describe('toString', function () {

it('should return the correct value', function () {

expect(date.toString()).to.equal('0001 01 01');

});

});


Expand Down

0 comments on commit 99fe821

Please sign in to comment.