Skip to content

Commit b592c8c

Browse files
committed
converter correction
1 parent 1584194 commit b592c8c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/bikram.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
let YearSaka = YearKali - 3179;
9797
let nepalimonth = saura_masa_num % 12;
9898
this.Year = YearSaka + 135 + Math.floor((saura_masa_num - nepalimonth) / 12);
99-
this.Month = (saura_masa_num + 1) % 12;
100-
this.Day = saura_masa_day +1;
99+
this.Month = (saura_masa_num +1 ) % 12;
100+
this.Day = saura_masa_day +1 ;
101101
}
102102

103103
// Public method to convert Bikram Sambat to Gregorian
@@ -106,7 +106,7 @@
106106
let YearKali = YearSaka + 3179;
107107
let ahar = Math.floor((YearKali * this.YugaCivilDays) / this.YugaRotation_sun);
108108
let [saura_masa_num, saura_masa_day] = this.getSauraMasaDay(ahar);
109-
bsMonth = (bsMonth + 12) % 12; // Adjust the month to the correct range
109+
bsMonth = (bsMonth + 11) % 12; // Month is 0 indexed so last month 11
110110
while (saura_masa_num !== bsMonth || saura_masa_day !== bsDay) {
111111
if (saura_masa_num < bsMonth || (saura_masa_num === bsMonth && saura_masa_day < bsDay)) {
112112
ahar++;
@@ -123,7 +123,7 @@
123123
let { year, month, day } = this.toGregorian(bsYear, bsMonth, bsDay);
124124
this.Year = year;
125125
this.Month = month;
126-
this.Day = day;
126+
this.Day = day +1; // Day Index Starts from 0, This is same as this.Day = saura_masa_day +1 ;
127127
}
128128

129129
getDayOfWeek() {

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ <h1 class="text-center">Nepali Date Converter</h1>
237237
</div>
238238
</div>
239239
</div>
240-
240+
<center><p><span style="color: #0000ff;">calendar is still not working</span></p></center>
241241
<div class="container">
242242
<div class="calendar" id="bikramCalendar">
243243
<h3>Bikram Sambat Calendar</h3>

0 commit comments

Comments
 (0)