Git Product home page Git Product logo

business's People

Contributors

bendavies avatar bilge avatar ceeram avatar dragosprotung avatar florianv avatar pyrech avatar raphaelstolt avatar sagikazarmark avatar stylecibot 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

business's Issues

Provide an example (or implementation) of 24/7 working time.

I wasn't able to figure out from examples how to nicely model 24/7 working time. It seems to be a common general case so if it's already implemented elegantly, it would be nice to have an example in the docs. Otherwise, this issue could be a starting point for discussion for potential implementation.

Prefer modern DateTime implementations

Specifically: DateTimeInterface and DateTimeImmutable.

Of course, feel free to close if you strictly target PHP 5.4 or lower. :-)

(Edit: DateTimeInterface and consorts were introduced in 5.5, not 5.4)

HALF BUSINESS DAY ADDITION

Hello,
How to add 1/2 business day to a date?
I give you an example:
In my work worked hours start from 7h30AM to 3h30PM in regular business day.
In half worked business day hours start from 7h30AM to11h3AM.
I am programming a leave request system. Employee should be able to take 1/2 business days.

Sorry if my english is not good.
:)

Accept DatePeriods as holidays

Holidays are usually not just one day (especially in summer). DatePeriods can be iterated through, so you can transform them into days internally.

But actually I wonder if holidays could be some kind of special day as well. For example a Holiday object. It could be used to ease creating different types of holidays (simple DateTime or DatePeriod).

If you like any of the above, I would be happy to provide a PR.

Big 👍 for this package. I was thinking about one for years now, but never had the time to make it.

Case saturday or sunday as working day

Hi guys, could you advise how can I set Saturday or Sunday as working day only in some cases( not always)?
The special day evaluator requires return an array of opening intervals.

This doesn't work:
new SpecialDay(Days::SATURDAY, function (\DateTime $date) {
if ('2015-05-29' === $date->format('Y-m-d')) {
return [['00:00', '23:59:59']];
}
return ;
});

Get closest closing time

Hi. Thanks for your work.

Is possible to get the closest closing time from a given date? For example
Days::MONDAY, [['08:00', '13:00'], ['14:00', '18:30']]
i need a function like
$business->closestClosing(new \DateTime('2017-07-24 10:00'));
return '13:00'.

thanks

Working day interval manipulation

Nice work on this project. :)

Business is close to what I need (manipulate a list of working days, excluding public holiday) but for my use case, it lacks of interval operations:

I need to do something like:

// Get the third working days starting from now
$date = $business->add(new \DateTime(), 3);

So I just wonder if this feature could enter in the scope of business?

Calculer la durée écoulée entre deux dates

Bonsoir Florian
Très intéressante cette librairie, J'aimerais savoir si c'est possible d'avoir la durée écoulée entre deux dates, bien-sur en considérant uniquement les jours ouvrables

Exemple 03-01-2016 14:00 au 10-10-2016 17:00 Temps écoulé 3j 6h30m

Merci

Installing through composer

Using the recommended method of installation through composer, the following exception is thrown:

[InvalidArgumentException]
Could not find package florianv/business at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

The opening time "xx:xx" must be before the closing time "xx:xx"

new Day(Days::TUESDAY, [['9 PM', '5 AM']])

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The opening time "21:00" must be before the closing time "05:00".'
I think in this case better not to throw an exception. Some night-clubs are open late and close next-day(like 5am)

Docblocks

I noticed a few minor things related to docblocks:

  • Integers are represented as integer instead of int (which is good IMO), but booleans are bool.
  • There are no @throws docblocks

Holidays::addHolidays is private

Hi Florian!

Thanks for a great library!
Can I ask why Holidays::addHolidays is private? I have a use case where i want to dynamically add holidays after the Business object has been instantiated, so I'm having resort to trickery to access Holidays::addHolidays at the moment.

Would you consider making that method public?

Thanks!

Get closest nth business day

Currently it is possible to calculate nth business day with subsequent calls to the closest method. I wonder if there is a better way internally.

Use case: depending on order date and shipping carrier, shipping date can vary. For example carrier one ships within two business days and so on.

Arithmetic using business hours...

Is there a way for me to use a timestamp and an interval to calculate the end timestamp.

i.e. what time is 6 business hours from 2020-11-12 12:00:00?

I feel like it can maybe achieved using the timeline but can't work out how to do it...

Thanks.

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.