jday function

double? jday(
  1. dynamic year, [
  2. int? mon,
  3. int? day,
  4. int? hr,
  5. int? minute,
  6. double? sec,
  7. double? msec,
])

Implementation

double? jday(dynamic year,
    [int? mon, int? day, int? hr, int? minute, double? sec, double? msec]) {
  if (year is DateTime) {
    final date = year;
    return _jdayInternal(
      date.year,
      date.month,
      date.day,
      date.hour,
      date.minute,
      date.second.toDouble(),
      date.millisecond.toDouble(),
    );
  }

  if (mon != null &&
      day != null &&
      hr != null &&
      minute != null &&
      sec != null) {
    return _jdayInternal(year as int, mon, day, hr, minute, sec, msec ?? 0);
  }
  return null;
}