Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
本项目支持中国节假日和工作日的判断。节假日判断是一个极具中国特色的问题,首先传统节日春节、端午和中秋无固定的公历日期,其次假期一般伴随着调休和补班,因而只能以国务院在每年末公布下一年放假通知为准。
为解决这个问题,常用解决方案一般为两种:
a. 第一种是使用一些厂商提供的API接口,但一般不是免费,且稳定性和访问速度不能很好的保证。
b. 第二种是自行开发代码在excel或数据库中进行维护,每年都要手动维护,容易忘记更新。
本项目结合以上两种方法的优点,使用提莫的神秘商店 提供的在线数据,存储在JSON中维护,封装了常用查询场景方法,兼顾效率和高级自定义功能,可满足各类使用场景,如有未覆盖的需求也可在ISSUE中提出,会第一时间进行适配。
<!-- 节假日API -->
<!-- 最新版本:https://search.maven.org/artifact/xyz.xiamang/holiday -->
<!-- ISSUES: https://github.com/YangShuqing/holiday/issues -->
<dependency>
<groupId>xyz.xiamang</groupId>
<artifactId>holiday</artifactId>
<version>0.0.1-2022</version>
</dependency>
/**
* 节假日API
* 最新版本:https://search.maven.org/artifact/xyz.xiamang/holiday
* ISSUES: https://github.com/YangShuqing/holiday/issues
*/
implementation 'xyz.xiamang:holiday:0.0.1-2022'
//只需初始化一次
HolidayService holidayService = new HolidayService();
//是否工作日 支持 date和string 格式:yyyyMMdd和yyyy-MM-dd
boolean f = holidayService.isHoliday("20210921");
//日期详情
DayDetail detail = holidayService.isHoliday("20210921");
//按类型批量查询
List<DayDetail> list = holidayService.queryDayByType(DayType.ALL_WORKDAY, "20210912", "20210922");
//按类型查询下个日期
DayDetail next = holidayService.nextDayByType(DayType.ALL_WORKDAY, "2021-09-18");
{
"code": 0, // 0服务正常。-1服务出错
"holiday": {
"10-01": {
"holiday": true, // 该字段一定为true
"name": "国庆节", // 节假日的中文名。
"wage": 3, // 薪资倍数,3表示是3倍工资
"date": "2018-10-01" // 节假日的日期
},
"10-02": {
"holiday": true, // 该字段一定为true
"name": "国庆节", // 节假日的中文名。
"wage": 3, // 薪资倍数,3表示是3倍工资
"date": "2018-10-01" // 节假日的日期
}
}
}
FAQs
A China holiday and workday util 中国节假日和工作日判断
We found that xyz.xiamang:holiday demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.