hasBeenScheduledForToday property

bool hasBeenScheduledForToday

Implementation

bool get hasBeenScheduledForToday {
  // fast out if no timestamp is set previously
  if (configuration?.lastTriggerTimestamp == null) return false;

  final now = DateTime.now();
  final midnight = DateTime(now.year, now.month, now.day);
  final sinceLastTime =
      now.millisecond - configuration!.lastTriggerTimestamp!.millisecond;
  final sinceMidnight = now.millisecond - midnight.millisecond;

  return (sinceLastTime < sinceMidnight);
}