DateTimeExtensions extension

Extension for DateTime with BuildContext support

on

Methods

format(String pattern) String

Available on DateTime, provided by the DateTimeExtensions extension

formattedDate(BuildContext context, {String pattern = 'yyyy-MM-dd'}) String

Available on DateTime, provided by the DateTimeExtensions extension

Get formatted date string based on locale from BuildContext
isInFuture() bool

Available on DateTime, provided by the DateTimeExtensions extension

Check if the DateTime is in the future
isInPast() bool

Available on DateTime, provided by the DateTimeExtensions extension

Check if the DateTime is in the past
isToday() bool

Available on DateTime, provided by the DateTimeExtensions extension

isYesterday() bool

Available on DateTime, provided by the DateTimeExtensions extension

Check if the DateTime is yesterday
timeAgo(BuildContext context) String

Available on DateTime, provided by the DateTimeExtensions extension

Get relative time description (e.g., "5 minutes ago")