Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New constraints: earlyStart, lateStart, earlyFinish, lateFinish #2

Open
hughgrigg opened this issue Jul 3, 2019 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@hughgrigg
Copy link
Contributor

It might be useful to have some business time constraints along the lines of earlyStart, lateStart, earlyFinish, lateFinish.

These would take an exact timestamp, i.e. for a single date and time only, and act as a constraint accordingly.

E.g. new earlyFinish('2019-07-03 13:00') rejects any time after 13:00 but only on 2019-07-03. Similar logic for the other three.

This would make it more natural to add single adjustments to start and finish times.

Currently you'd have to do something like new NotConstraint(new Dates('2019-07-03').andAlso(new BetweenHoursOfDay('13', '00'))) which works OK but is not intuitive at all.

@hughgrigg hughgrigg added the enhancement New feature or request label Jul 3, 2019
@hughgrigg hughgrigg self-assigned this Jul 3, 2019
@hughgrigg
Copy link
Contributor Author

This could be made more useful by having the constructor take the time of day as the first argument, and then any number of constraints as the rest.

E.g. new earlyFinish('13:00', new Dates('2019-07-03')), so the first argument would probably be typed as HourOfDay. Then you could build these constraints flexibly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant