SmartDateExtension extension
Smart DateTime extensions
- on
Properties
- age → int
-
Available on DateTime, provided by the SmartDateExtension extension
Age in years from this date to todayno setter - calendar → String
-
Available on DateTime, provided by the SmartDateExtension extension
Returns calendar stringno setter - dayOfYear → int
-
Available on DateTime, provided by the SmartDateExtension extension
Day number of the year (1–366)no setter - endOfDay → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
End of the day — 2024-06-15 23:59:59no setter - endOfMonth → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
End of the month — last day 23:59:59no setter - endOfWeek → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
End of the week — Sunday 23:59:59no setter - endOfYear → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
End of the year — Dec 31 23:59:59no setter - isAfternoon → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether time is afternoon (12PM–5PM)no setter - isEvening → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether time is evening (5PM–9PM)no setter - isFuture → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is in the futureno setter - isLeapYear → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this year is a leap yearno setter - isMorning → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether time is morning (6AM–12PM)no setter - isNight → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether time is night (9PM–6AM)no setter - isPast → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is in the pastno setter - isQ1 → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is in Q1 (Jan–Mar)no setter - isQ2 → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is in Q2 (Apr–Jun)no setter - isQ3 → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is in Q3 (Jul–Sep)no setter - isQ4 → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is in Q4 (Oct–Dec)no setter - isToday → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is todayno setter - isTomorrow → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is tomorrowno setter - isWeekday → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is a weekday (Monday–Friday)no setter - isWeekend → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is a weekend (Saturday or Sunday)no setter - isYesterday → bool
-
Available on DateTime, provided by the SmartDateExtension extension
Whether this date was yesterdayno setter - nextFriday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Next Friday from this dateno setter - nextMonday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Next Monday from this dateno setter - nextSaturday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Next Saturday from this dateno setter - nextSunday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Next Sunday from this dateno setter - nextThursday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Next Thursday from this dateno setter - nextTuesday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Next Tuesday from this dateno setter - nextWednesday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Next Wednesday from this dateno setter - previousFriday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Previous Friday from this dateno setter - previousMonday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Previous Monday from this dateno setter - previousSaturday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Previous Saturday from this dateno setter - previousSunday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Previous Sunday from this dateno setter - previousThursday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Previous Thursday from this dateno setter - previousTuesday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Previous Tuesday from this dateno setter - previousWednesday → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Previous Wednesday from this dateno setter - quarter → int
-
Available on DateTime, provided by the SmartDateExtension extension
Quarter of the year (1–4)no setter - shortTimestamp → String
-
Available on DateTime, provided by the SmartDateExtension extension
Returns short timestampno setter - startOfDay → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Start of the day — 2024-06-15 00:00:00no setter - startOfMonth → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Start of the month — 1st 00:00:00no setter - startOfWeek → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Start of the week — Monday 00:00:00no setter - startOfYear → DateTime
-
Available on DateTime, provided by the SmartDateExtension extension
Start of the year — Jan 1 00:00:00no setter - timeAgo → String
-
Available on DateTime, provided by the SmartDateExtension extension
Returns relative time stringno setter - to12Hour → String
-
Available on DateTime, provided by the SmartDateExtension extension
Returns 12-hour format — "02:30 PM"no setter - to24Hour → String
-
Available on DateTime, provided by the SmartDateExtension extension
Returns 24-hour format — "14:30"no setter - toISO → String
-
Available on DateTime, provided by the SmartDateExtension extension
Returns ISO 8601 without milliseconds — "2024-06-15T14:30:00"no setter - toReadable → String
-
Available on DateTime, provided by the SmartDateExtension extension
Returns "Saturday, 15 June 2024"no setter - toTimeString → String
-
Available on DateTime, provided by the SmartDateExtension extension
Returns 24-hour time string — "14:30:00"no setter - weekOfYear → int
-
Available on DateTime, provided by the SmartDateExtension extension
Week number of the year (1–53)no setter
Methods
-
addWorkingDays(
int days) → DateTime -
Available on DateTime, provided by the SmartDateExtension extension
Addsdaysworking days — skips weekends -
copyWith(
{int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond}) → DateTime -
Available on DateTime, provided by the SmartDateExtension extension
Returns a copy of this DateTime with given fields replaced -
daysSince(
DateTime other) → int -
Available on DateTime, provided by the SmartDateExtension extension
Days sinceotherdate -
daysUntil(
DateTime other) → int -
Available on DateTime, provided by the SmartDateExtension extension
Days untilotherdate — positive if future, negative if past -
format(
String pattern) → String -
Available on DateTime, provided by the SmartDateExtension extension
Format date using custom pattern -
isBetween(
DateTime start, DateTime end) → bool -
Available on DateTime, provided by the SmartDateExtension extension
Whether this date falls betweenstartandend(inclusive) -
isSameDay(
DateTime other) → bool -
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is the same day asother -
isSameMonth(
DateTime other) → bool -
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is in the same month asother -
isSameWeek(
DateTime other) → bool -
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is in the same week asother -
isSameYear(
DateTime other) → bool -
Available on DateTime, provided by the SmartDateExtension extension
Whether this date is in the same year asother -
timeAgoIn(
SdfLocale locale) → String -
Available on DateTime, provided by the SmartDateExtension extension
Returns relative time in given locale -
workingDaysUntil(
DateTime other) → int -
Available on DateTime, provided by the SmartDateExtension extension
Number of working days between this andother