'Convert a Julian day number to a year/month/day tuple
of this calendar (matching jQuery calendars algorithm)
@param jd: the Julian day number'

@classmethod
def from_jd(cls, jd):

    jd = (math.floor(jd) + 0.5)
    depoch = (jd - cls.to_jd(475, 1, 1))
    cycle = math.floor((depoch / 1029983))
    cyear = (depoch % 1029983)
    if (cyear != 1029982):
        aux1 = math.floor((cyear / 366))
        aux2 = (cyear % 366)
        ycycle = ((math.floor(((((2134 * aux1) + (2816 * aux2)) + 2815) / 1028522)) + aux1) + 1)
    else:
        ycycle = 2820
    year = ((ycycle + (2820 * cycle)) + 474)
    if (year <= 0):
        year -= 1
    yday = ((jd - cls.to_jd(year, 1, 1)) + 1)
    if (yday <= 186):
        month = math.ceil((yday / 31))
    else:
        month = math.ceil(((yday - 6) / 30))
    day = ((jd - cls.to_jd(year, month, 1)) + 1)
    return (int(year), int(month), int(day))
