mSize function

int mSize(
  1. dynamic y,
  2. dynamic m
)

Implementation

int mSize(y, m) {
  bool leap = (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0);
  return m == 2 ? (leap ? 29 : 28) : ([4, 6, 9, 11].contains(m) ? 30 : 31);
}