Dayjs: WorkingDays plugin

Created on 15 Apr 2020  路  5Comments  路  Source: iamkun/dayjs

Issue type

proposal

Description

recently I had the need for a function that calculate working days (days - weekends - custom array of holidays) from a certain date. I believe it could be easily translated into a plugin if anyone is sharing the same need.

Most helpful comment

Hey guys, we've just published our Business Days plugin to npm. You can also find the source code on our Github.

We are more than happy to accept bugs, improvements and PRs!

All 5 comments

It will be great if you could build your own plugin and publish it to npm so that could share it with others easily.

thanks @iamkun, will surely do :)

Hey @fes300 @iamkun, in a weird turn of events I was looking for the exact same thing yesterday. I forked dayjs yesterday and spent the day writing a BusinessDays plugin. I was intending to put the PR in later on today.

@iamkun, would you rather the plugin was published separately from DayJS? It's just that in your docs you say "Feel free to open a pull request to share your plugin."

The plugin I wrote only supports Business Days (i.e no Holidays) at the moment, as I wanted to discuss that with you @iamkun. Holidays would probably require using Locale, but I see that Locale is also a plugin for Dayjs. Should a plugin require another plugin?

Hi, Of course, all plugins are welcomed.

However, we only choose those PRs which suit most of our users' needs to get merged into our main code.

For plugins that targeting to some specific use case, it's better to manage by their own, such as https://github.com/alibaba-aero/jalaliday

Hey guys, we've just published our Business Days plugin to npm. You can also find the source code on our Github.

We are more than happy to accept bugs, improvements and PRs!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eugeneoshepkov picture eugeneoshepkov  路  3Comments

fundon picture fundon  路  5Comments

Sunrise1970 picture Sunrise1970  路  4Comments

paraself picture paraself  路  3Comments

idasbiste picture idasbiste  路  4Comments