date<T> static method

ReadableColumn<T> date<T>(
  1. String label, {
  2. required DateTime value(
    1. T v
    ),
  3. String format(
    1. DateTime d
    )?,
  4. double? width = 124,
  5. bool sortable = true,
})

A formatted date (monospace). format defaults to ISO yyyy-MM-dd.

Implementation

static ReadableColumn<T> date<T>(
  String label, {
  required DateTime Function(T v) value,
  String Function(DateTime d)? format,
  double? width = 124,
  bool sortable = true,
}) =>
    ReadableColumn<T>(
      label,
      type: ReadableColumnType.date,
      width: width,
      sortable: sortable,
      sortKey: (v) => value(v),
      cell: (ctx, v) => ReadableCells.date(value(v), format: format),
    );