duration library

Support for doing something awesome.

More dartdocs go here.

Classes

DurationTersity
Provides constants used to control terity of prettyDuration and printDuration.

Constants

aDay → const Duration
Duration of a day
const Duration(days: 1)
aMicrosecond → const Duration
Duration of a microsecond
const Duration(microseconds: 1)
aMillisecond → const Duration
Duration of a millisecond
const Duration(milliseconds: 1)
aMinute → const Duration
Duration of a minute
const Duration(minutes: 1)
anHour → const Duration
Duration of an hour
const Duration(hours: 1)
aSecond → const Duration
Duration of a second
const Duration(seconds: 1)
aWeek → const Duration
Duration of a week
const Duration(days: 7)

Functions

days(int days) Duration
hours(int hours) Duration
minutes(int minutes) Duration
ms(int milliseconds) Duration
prettyDuration(Duration duration, { DurationTersity tersity: DurationTersity.second, DurationLocale locale: const EnglishDurationLocale(), String spacer, String delimiter, String conjunction, bool abbreviated: false }) String
Converts duration into legible string with given level of tersity [...]
prettyMilliseconds(Duration duration, { bool terse: false, DurationLocale language: const EnglishDurationLocale(), String separator: ' ', bool abbreviated: false }) String
Pretty format duration in terms of milliseconds. [...]
prettySeconds(Duration duration, { bool terse: false, DurationLocale language: const EnglishDurationLocale(), String separator: ' ', String delimiter: ' ', bool abbreviated: false }) String
Pretty format duration in terms of seconds. [...]
printDuration(Duration duration, { DurationTersity tersity: DurationTersity.second, DurationLocale locale: const EnglishDurationLocale(), String spacer, String delimiter, String conjugation, bool abbreviated: false }) String
printMilliseconds(Duration duration, { bool terse: false, DurationLocale language: const EnglishDurationLocale(), String separator: ' ', bool abbreviated: false }) String
Pretty print duration in terms of milliseconds. [...]
seconds(int seconds) Duration
us(int microseconds) Duration