fromNow method

String fromNow({
  1. bool dropPrefixOrSuffix = false,
  2. Abbreviation form = Abbreviation.none,
})

Example when using LocalizationEnUs:

If this is yesterday, will result "a day ago"

If this is tomorrow, will result "in a day"

This will not return precise duration. See MomentLocalization.relativeThreshold for details

Use fromNowPrecise

Implementation

String fromNow({
  bool dropPrefixOrSuffix = false,
  Abbreviation form = Abbreviation.none,
}) =>
    from(
      DateTimeConstructors.nowWithTimezone(isUtc),
      dropPrefixOrSuffix: dropPrefixOrSuffix,
      form: form,
    );