getCurrentDate function

DateTime getCurrentDate(
  1. int index,
  2. int baseIndex,
  3. DateTime base
)

Implementation

DateTime getCurrentDate(int index, int baseIndex, DateTime base) {
  if (baseIndex == index) return base;
  if (index > baseIndex)
    return base.add(Duration(days: index - baseIndex));
  else
    return base.add(Duration(days: index - baseIndex));
}