toStringDifference method

String toStringDifference(
  1. DateTime other, {
  2. bool asUTC = false,
})

Returns this DateTime.toString removing the part that is equals to other.

  • If asUTC is true forces an UTC String.

Implementation

String toStringDifference(DateTime other, {bool asUTC = false}) {
  var d1 = asUTC ? toUtc() : this;
  var d2 = asUTC ? other.toUtc() : other;

  var s1 = d1.toString();
  var s2 = d2.toString();

  var sDiff = s1.tailDifferent(s2,
      splitIndexes: [11, 14, 17, 20], splitIndexesAlreadySorted: true);
  return sDiff;
}