isSameDay static method

bool isSameDay(
  1. DateTime a,
  2. DateTime b
)

Check if two dates are the same day

Example:

final date1 = DateTime(2023, 1, 1, 10, 30);
final date2 = DateTime(2023, 1, 1, 15, 45);
FSDates.isSameDay(date1, date2); // true

Implementation

static bool isSameDay(DateTime a, DateTime b) {
  return a.year == b.year && a.month == b.month && a.day == b.day;
}