npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

banbancoachbidate

v1.0.17

Published

斑斑教练BI功能日期格式工具

Readme

  • getCurrentWeek 获取当前是第几周

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :--: | :------------: | :----------: | :------: | :----: | :----: | | Date | 当前选中的日期 | String|Date | 是 | - | - |

    返回值:

    | 类型 | 说明 | | ---------------------------------- | ---------------------------- | | Object<year: String, week: String> | 返回当前日期是哪一年的第几周 |

  • getWeekDay 获取当前选中日期的一周周期

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :--: | :----------------: | :----------: | :------: | :------------: | :----: | | date | 当前选中的日期 | String|Date | 是 | - | - | | type | 返回的日期格式类型 | String | 否 | string | date | date |

    返回值:

    | 类型 | 说明 | | --------------------- | ------------------------------------------------------ | | Array<String | Date> | 返回一周的开始结束财务时间['2022-12-26', '2023-01-01'] |

  • getCurrentMonth 获取当前日期所在月份

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :-----------: | :------------: | :----------: | :------: | :---------: | :----: | | date | 当前选中的日期 | String|Date | 是 | - | - | | isCustomMonth | 是否获取自然月 | Boolean | 否 | true|false | true |

    返回值:

    | 类型 | 说明 | | ------ | ------------------------- | | String | 返回当前月的字符串YYYY-MM |

  • getCustonMonth 根据日期获取财务月 26-25号

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :----: | :------------------------------------: | :----------: | :------: | :---------: | :----: | | date | 当前选中的日期 | String|Date | 是 | - | - | | isTime | 是否追加起止时分秒 00:00:00 - 23:59:59 | Boolean | 否 | true|false | false |

    返回值:

    | 类型 | 说明 | | ------------- | ---------------------------------------------------- | | Array | 返回当前财务月的起止时间['2023-01-26', '2023-02-25'] |

  • getQuarter 获取当前第几个季度

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :--: | :------------: | :----------: | :------: | :----: | :----: | | date | 当前选中的日期 | String|Date | 是 | - | - |

    返回值:

    | 类型 | 说明 | | ------------- | --------------------------- | | Array | 返回当的年份跟季度[2023, 1] |

  • getQuartersRegion 获取季度的起止时间

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :--: | :--------------------------------: | :-------------------: | :------: | :----: | :----: | | date | 某年某季度例如:2023-Q1或[2023, 1] | String|Array | 是 | - | - |

    返回值:

    | 类型 | 说明 | | ------------- | ----------------------------------------------------- | | Array | 当前季度的起止的财务时间 ['2022-12-26', '2023-03-25'] |

  • getCurrentHalfYear 获取当前时间对应的年份以及上半年还是下半年

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :--: | :------------: | :----------: | :------: | :----: | :----: | | date | 当前选中的日期 | String|Date | 是 | - | - |

    返回值:

    | 类型 | 说明 | | ------------- | ------------------------------------------------------------ | | Array | 当前时间的年份以及上下半年 [2023, 1]或[2023, 2] 1:上半年 2:下半年 |

  • getHalfYear 获取半年的起止时间

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :--: | :-----------------------------: | :-----------: | :------: | :----: | :----: | | half | [年份,上半年/下半年] [2023, 1] | Array | 是 | - | - |

    返回值:

    | 类型 | 说明 | | ------------- | ----------------------------------------------------------- | | Array | 当前上下半年开始结束的财务时间 ['2022-12-26', '2023-06-25'] |

  • getCurrentYear 获取当前年份

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :--: | :------------: | :----------: | :------: | :----: | :----: | | date | 当前选择的时间 | String|Date | 是 | - | - |

    返回值:

    | 类型 | 说明 | | ------ | ------------------ | | Number | 当前日期的财务年份 |

  • getYear 获取一年的起止时间

    入参:

    | 参数 | 描述 | 类型 | 是否必填 | 可选值 | 默认值 | | :--: | :------------: | :----------: | :------: | :----: | :----: | | date | 当前选择的时间 | String|Date | 是 | - | - |

    返回值:

    | 类型 | 说明 | | ------------- | --------------------------------------------------- | | Array | 当前年度起止的财务时间 ['2022-12-26', '2023-12-25'] |