Dates class

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

initializeDateFormat({String? localization}) Future<void>
Initializes date formatting for a given localization (default: 'en').
pDateFormatter({String? localization}) → DateFormat
Returns a DateFormat for date-only patterns.
pDateTimeFormatter({String? localization}) → DateFormat
Returns a DateFormat for date and time patterns.
pDateTimeToString(DateTime? dateTime, {String? defaultValue, String? localization}) String
Converts a DateTime object to a formatted date-time string.
pDateToString(DateTime? dateTime, {String? defaultValue, String? localization}) String
Converts a DateTime object to a formatted date string.
pGetDateTimeCustomFormat(DateTime? dateTime, String format, {String? defaultValue, String? localization}) String
Formats dateTime with a custom format.
pStringToDate(String date) DateTime
Parses a String into a DateTime safely. Returns a fallback date if parsing fails.
tryParseFlexible(String? dateStr) DateTime?