roundDown method

DateTime roundDown({
  1. Duration delta = const Duration(minutes: 15),
})

Implementation

DateTime roundDown({Duration delta = const Duration(minutes: 15)}) {
  return DateTime.fromMillisecondsSinceEpoch(
    millisecondsSinceEpoch - millisecondsSinceEpoch % delta.inMilliseconds,
  );
}