code: function d2j(jdn) {
      var gy = d2g(jdn).gy // Calculate Gregorian year (gy).
          , jy = gy - 621
          , r = jalCal(jy)
          , jdn1f = g2d(gy, 3, r.march)
          , jd
          , jm
          , k;
  
      // Find number of days that passed since 1 Farvardin.
      k = jdn - jdn1f;
      if (k >= 0) {
          if (k <= 185) {
              // The first 6 months.
              jm = 1 + div(k, 31);
              jd = mod(k, 31) + 1;
              return  { jy: jy
                  , jm: jm
                  , jd: jd
              };
          } else {
              // The remaining months.
              k -= 186;
          }
      } else {
          // Previous Jalali year.
          jy -= 1;
          k += 179;
          if (r.leap === 1)
              k += 1;
      }
      jm = 7 + div(k, 30);
      jd = mod(k, 30) + 1;
      return  { jy: jy
          , jm: jm
          , jd: jd
      };
  }
docs: /*
  Converts the Julian Day number to a date in the Jalali calendar.
  @param jdn Julian Day number
  @return
  jy: Jalali year (1 to 3100)
  jm: Jalali month (1 to 12)
  jd: Jalali day (1 to 29/31)