toSimpleFormat method

String toSimpleFormat()

Converts the DateTime to a string object supported by the field

Implementation

String toSimpleFormat() {
  String pad(int value) {
    return value.toString().padLeft(2, '0');
  }

  return '$year-${pad(month)}-${pad(day)} ${pad(hour)}:${pad(minute)}';
}