function j2d(jy, jm, jd) {
		// Correct month overflow/underflow for correct day calculation
		while (jm < 1) {
			jm += 12;
			jy--;
		}
		while (jm > 12) {
			jm -= 12;
			jy++;
		}
		var r = jalCal(jy);
		return g2d(r.gy, 3, r.march) + (jm - 1) * 31 - div(jm, 7) * (jm - 7) + jd - 1;
	}
/*
		Converts a date of the Jalaali calendar to the Julian Day number.
		@param jy Jalaali year (1 to 3100)
		@param jm Jalaali month (1 to 12)
		@param jd Jalaali day (1 to 29/31)
		@return Julian Day number
	*/
Converts a date of the Jalaali calendar to the Julian Day number.
Converts a date of the Jalaali calendar to the Julian Day number .
function j2d(jy, jm, jd) {
		while (jm < 1) {
			jm += 12;
			jy--;
		}
		while (jm > 12) {
			jm -= 12;
			jy++;
		}
		var r = jalCal(jy);
		return g2d(r.gy, 3, r.march) + (jm - 1) * 31 - div(jm, 7) * (jm - 7) + jd - 1;
	}
function j2d ( jy , jm , jd ) { while ( jm < 1 ) { jm += 12 ; jy -- ; } while ( jm > 12 ) { jm -= 12 ; jy ++ ; } var r = jalCal ( jy ) ; return g2d ( r . gy , 3 , r . march ) + ( jm - 1 ) * 31 - div ( jm , 7 ) * ( jm - 7 ) + jd - 1 ; }
Converts a date of the Jalaali calendar to the Julian Day number.
Converts a date of the Jalaali calendar to the Julian Day number .
// Correct month overflow/underflow for correct day calculation