leap-year 检查某一年是否为闰年 本库由坚果移植,感谢大家对坚果派的支持。 leap_year OpenHarmony ohpm 环境配置等更多内容,请参考如何安装 OpenHarmony ohpm 包 二、使用 import isLeapYear from "nutpi/leap-year " import isLeapYear from "@nutpi/leap-year" @Entry @Component struct Index { @State flag: boolean
If it wasn't a leap-year, we have to adjust */ if (tm->tm_mon>1 && ((year+2)%4)) res -= DAY; res