mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
This makes it less likely to run into weird bugs if we need to tweak the value in the future.
10 lines
258 B
Dart
10 lines
258 B
Dart
import 'consts.dart';
|
|
|
|
double chartGetInterval(DateTime first, DateTime last, {divider = 3}) {
|
|
final dayDiff = last.difference(first);
|
|
|
|
return dayDiff.inMilliseconds == 0
|
|
? CHART_MILLISECOND_FACTOR
|
|
: dayDiff.inMilliseconds.abs() / divider;
|
|
}
|