src/Timeline.cpp
int daysInFollowingMonth(int year, int month)
{
  month +=1;
  if (month == 12)
  {
    year += 1;
    month -= 12;
  }
  static const int days[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int d = days[month];
  if (month == 1 && ((year % 100 != 0) ^ (year % 400 == 0)) && (year % 4 == 0)) // February of a leap year
    ++d;
  return d;
}
// for incrementing time in months preserving day of month
// e.g. passing 2020,1 will return 29 (leap)
for incrementing time in months preserving day of month
e.g. passing 2020,1 will return 29 (leap)
for incrementing time in months preserving day of month e . g . passing 2020 1 will return 29 ( leap )
int daysInFollowingMonth(int year, int month)
{
  month +=1;
  if (month == 12)
  {
    year += 1;
    month -= 12;
  }
  static const int days[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int d = days[month];
  if (month == 1 && ((year % 100 != 0) ^ (year % 400 == 0)) && (year % 4 == 0)) 
    ++d;
  return d;
}
int daysInFollowingMonth ( int year , int month ) { month += 1 ; if ( month == 12 ) { year += 1 ; month -= 12 ; } static const int days [ ] { 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ; int d = days [ month ] ; if ( month == 1 && ( ( year % 100 != 0 ) ^ ( year % 400 == 0 ) ) && ( year % 4 == 0 ) ) ++ d ; return d ; }
for incrementing time in months preserving day of month
e.g.
for incrementing time in months preserving day of month e . g .
// February of a leap year