DateFormatUtil class
A utility class for formatting dates in a consistent and locale-aware manner.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
formatDateRange(
DateTime start, DateTime end) → String - Formats a date range (e.g., "Apr 10 - May 15, 2025").
-
formatLong(
DateTime date) → String - Formats a date in a long format (e.g., "April 10, 2025").
-
formatNumeric(
DateTime date) → String - Formats a date in a numeric format (e.g., "10/04/2025").
-
formatRelative(
DateTime date) → String - Formats a date in a relative format (e.g., "2 days ago", "in 3 months").
-
formatShort(
DateTime date) → String - Formats a date in a short format (e.g., "Apr 10, 2025").