calcite-avatica icon indicating copy to clipboard operation
calcite-avatica copied to clipboard

[CALCITE-3078] Duplicate code lastDay in calcite-avatica and calcite

Open ambition119 opened this issue 5 years ago • 0 comments

Fix ISSUE #3078

The code of lastDay appears in calcite

 private static int lastDay(int y, int m) {
    switch (m) {
    case 2:
      return y % 4 == 0
          && (y % 100 != 0
          || y % 400 == 0)
          ? 29 : 28;
    case 4:
    case 6:
    case 9:
    case 11:
      return 30;
    default:
      return 31;
    }
  }

, and appears in calcite-avatica. I think the duplicate code can change the calcite-avatica to public function then be used by calcite.

ambition119 avatar May 17 '19 02:05 ambition119