Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/panshuangqing/holiday

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/panshuangqing/holiday

  • v0.0.0-20200128141316-c17e22d8cdc6
  • Source
  • Go
  • Socket score

Version published
Created
Source

holiday

项目需要 计算工作日时间, 排除周末和 法定节假日, 需要现将 每个节假日 先 按照开始和结束时间 写入带数据库,

然后按照 线段原理将 时间点 排序到 线段上 计算每一段的时间 diff

粒度是到 天, 数据库的 创建表的语句 运行时 先创建数据库, 使用脚本获取 一年的所有的假期 时间格式 like 2020-01-01 假期包括周六和周日 将假期的开始和结束时间戳 写入到数据库中形成点

计算工作日时间时, 先从数据库中获取所有的假期时间点, 开始和结束时间和其中的假期点 构造一个线段, 在线端上直接累加该计算的时间

FAQs

Package last updated on 28 Jan 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc