Code Monkey home page Code Monkey logo

luxon-business-days's People

Contributors

amaidah avatar att14 avatar dasantonym avatar delki8 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

luxon-business-days's Issues

Luxon 2.0

Hello!

Is there any plan to update luxon-business-days to support newly released Luxon 2.0?

Thanks!

ESM support

Do you plan to add support to this library to allow it to be imported as ESM (ECMAScript module)?

I'm working on removing CommonJS dependencies from a project. Luxon itself works as ESM, but this plugin doesn't.

Registering custom holidayMatcher is not working.

Adding custom holidayMatchers didn't work for me I used the example of isCelebratingKobe function changed the dates, plusBusiness is not taking into consideration the dates in isCelebratingKobe at all.

Can one help me in this regards please?

plusBusiness not giving consistent results

Given this example:

https://codesandbox.io/s/luxon-business-days-holiday-ovveride-example-forked-3uf6ob?file=/src/index.js

If you iterate the date in line 5 and start incrementing the day value you will notice that sometimes the result date is 9 and sometimes 11 days from the start date. This IMHO should always give the same time difference (I think 11 days is the correct value). There are no holidays in September. Why this is happening?

I guess it is just Friday and my thinking was slow :D Everything works fine... It is a matter of either stepping into one or two weekends...

plusBusiness does not retain time zone in some cases

Thanks for this very useful library. I expected that calling plusBusiness would retain the time zone but it appears that isn't happening.

Here's an example sandbox that shows if you call plusBusiness on a DateTime in UTC, the resulting DateTime will be in the local time zone instead of UTC.

I don't see anything in the docs or tests concerning time zones, but it seems likely this is not intended behavior.

Thanks

`plusBusiness`/`minusBusiness` do not work properly with default holiday matchers

This is because many of the holiday matchers do an object comparison of the two datetimes. For example, the isThanksgivingDay returns +inst === +thanksgivingDay when it should return something like the Christmas matcher matchesMonth && matchesDay.

const { DateTime } = require('luxon-business-days');

const dt = DateTime.local();
const { availableHolidayMatchers } = dt;

availableHolidayMatchers.isThanksgivingDay(
  DateTime.fromObject({ day: 25, month: 11, year: 2021 })
)
// true

availableHolidayMatchers.isThanksgivingDay(
  DateTime.fromObject({ day: 25, month: 11, year: 2021, zone: 'UTC' })
)
// false

availableHolidayMatchers.isThanksgivingDay(
  DateTime.fromObject({ day: 25, month: 11, year: 2021, hour: 1 })
)
// false

make getEasterMonthAndDay function available in npm/yarn

How would you import the getEasterMonthAndDay function from ./helpers when the package is installed from yarn or npm?

Looking through node_modules it seems that the src directory is not there so it cannot be imported directly.

The reason for using this is that sometimes one may need to know the date of Easter and then add a holiday based on this date. e.g. Good Friday which is a holiday in some countries.

Typescript support

Please implement the @types/luxon-business-days in order to work with typescript, like the main library ๐Ÿ‘Œ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.