compareTo method
Implemented from Comparable which equal 0 means this and other are
the same, greater than 0 means other is greater and lesser than 0
means other is lesser
Implementation
@override
int compareTo(YearMonth other) =>
((other.year - this.year) * 12) + (other.month - this.month);