MeTuple.date constructor

MeTuple.date(
  1. String key,
  2. DateTime val
)

Create a tuple with a date value

Implementation

factory MeTuple.date(String key, DateTime val) {
  final y = '${val.year}'.padLeft(4, '0');
  final m = '${val.month}'.padLeft(2, '0');
  final d = '${val.day}'.padLeft(2, '0');
  return MeTuple(key, '$y$m$d');
}