Skip to content

Commit

Permalink
Kali Year Correction and ahargana added
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjayPrabhakaran committed May 23, 2024
1 parent 13a84b1 commit b10789e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions SJPv6/www/sjp.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ function handleErr(msg,url,l){
Date.prototype.getJulian = function() {
return Math.floor((this / 86400000) - (this.getTimezoneOffset()/1440) + 2440587.5);
}
Date.prototype.getAhargana = function(){
return Math.ceil(this / 86400000+1852121);
}
Date.prototype.getKaliAbda=function(){
KaliYear = this.getFullYear()+3101;
BeforeApr14 = (this.getMonth()*31+this.getDate())>104?0:1; //Jan to April 14th (31+28+31+14 = 104 days )
KaliYear = KaliYear-BeforeApr14;
return KaliYear;
}

Date.prototype.getMyTimezoneOffset=function(){
if(Date.MyTimezoneOffset == null){
Expand Down Expand Up @@ -574,12 +583,13 @@ function getPanchanga(date_time,longitude,latitude){
var p = Math.round(this.nakshatra_cur+0.5)+(this.vara_cur+1)+Math.round(this.tithi_cur+0.5)+Math.round(chart[0].long/30+0.5);
this.html+= "\n<br/><b>Panchaka Nx+Tithi+vara+lagna=</b>"+p+"->"+panchaka[p%9];
}
KaliYear = date_time.getFullYear()+3102;
BeforeApr14 = (date_time.getMonth()*31+date_time.getDate())>104?0:1; //Jan to April 14th (31+28+31+14 = 104 days )
KaliYear = KaliYear-BeforeApr14;
// KaliYear = date_time.getFullYear()+3101;
// BeforeApr14 = (date_time.getMonth()*31+date_time.getDate())>104?0:1; //Jan to April 14th (31+28+31+14 = 104 days )
//KaliYear = KaliYear-BeforeApr14;
this.html+= "\n<br/><br/><b>Samvatsara </b>"+this.sSamvatsara+"("+(this.iSamvatsara+1)+")";
this.html+= "\n<br/><b>Pancha Samvatsara </b>"+aPanchaSamvatsara[(this.iSamvatsara+1)%5];
this.html+= "\n<br/><b>Kali Abda:</b>"+KaliYear;
this.html+= "\n<br/><b>Kali Abda:</b>"+date_time.getKaliAbda();
this.html+= "\n<br/><b>Ahargana:</b>"+date_time.getAhargana();
this.html+= "\n<br/><b>Saura Maasa </b>"+this.sSauraMaasa;
this.html+= "\n<br/><b>Ishta Ghati <b>"+((Date.parse(this.date_time)-Date.parse(this.sunrise))/minutes/24).toFixed(4);
this.html+= "\n<br/><b> Ayanamsha:</b>" + toDeg(this.AscData.Ayanamsa)+
Expand Down

0 comments on commit b10789e

Please sign in to comment.