getChineseZodiacByYear static method

String getChineseZodiacByYear(
  1. int year
)

生肖:按公历年份 year 粗判(year % 12,从「猴」起)。

Java 的 % 对负年份会得负下标(越界抛错),Dart 的 % 结果恒非负, 故此处无需对负年份做取正处理。

Implementation

static String getChineseZodiacByYear(int year) => _chineseZodiac[year % 12];