作者:坚果 团队:坚果派 团队介绍:坚果派由坚果创建,团队拥有12个华为HDE,以及若干其他领域的三十余位万粉博主运营。
检查某一年是否为闰年
本库由坚果移植,感谢大家对坚果派的支持。
ohpm install @nutpi/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 = true;
build() {
Row() {
Column() {
Text(this.flag ? "坚果" : "坚果派")
.fontSize(50)
.fontWeight(FontWeight.Bold).onClick(() => {
this.flag = isLeapYear(2014);
})
}
.width('100%')
}
.height('100%')
}
}
本项目基于 Apache ,请自由地享受和参与开源。
访问链接[1]
参考资料
[1]
访问链接: https://ohpm.openharmony.cn/#/cn/detail/@nutpi%2Fleap_year