calculateEvent method
Calculate the time of an specific sun event
Returns in UTC.
Implementation
DateTime? calculateEvent(DateTime date, Zenith zenith, EventType type) {
final lastMidnight = DateTime(date.year, date.month, date.day);
final eventMils = _calculate(date, zenith, type);
if (eventMils == null) {
return null;
}
final mils = (lastMidnight.millisecondsSinceEpoch + eventMils).floor();
return DateTime.fromMillisecondsSinceEpoch(mils, isUtc: true);
}