point85 / shiftsharp Goto Github PK
View Code? Open in Web Editor NEWC# port of java Shift project
License: MIT License
C# port of java Shift project
License: MIT License
Hello,
I would like to thank you for this awesome library first.
I tried to analyze why my schedule settings not working as I expected.
I need two twelve hours shifts - day & night, four teams 24/7 (see picture)
I configured my schedule like this:
` _workSchedule = new WorkSchedule(scheduleName, description);
// Day shift, starts at 06:00 for 12 hours
Shift day = _workSchedule.CreateShift("Day", "Day shift", new LocalTime(6, 0, 0), Duration.FromHours(12));
// Night shift, starts at 18:00 for 12 hours
Shift night = _workSchedule.CreateShift("Night", "Night shift", new LocalTime(18, 0, 0), Duration.FromHours(12));
// rotation
Rotation rotation = _workSchedule.CreateRotation("My rotation",
"description..");
rotation.AddSegment(day, 2, 2);
rotation.AddSegment(night, 3, 2);
rotation.AddSegment(day, 2, 3);
rotation.AddSegment(night, 2, 2);
rotation.AddSegment(day, 3, 2);
rotation.AddSegment(night, 2, 3);
// reference date for start of shift rotations
LocalDate referenceDate = new LocalDate(2019, 1, 7);
_workSchedule.CreateTeam("Blue", "First team", rotation, referenceDate);
_workSchedule.CreateTeam("Yellow", "Second team", rotation, referenceDate.PlusDays(14));
_workSchedule.CreateTeam("Red", "Third team", rotation, referenceDate.PlusDays(21));
_workSchedule.CreateTeam("Green", "Fourth team", rotation, referenceDate.PlusDays(7));`
Problem was when I tried 04.02.2019 1:55 - I expected that output will be Red team..But result was Blue team.. So I wanted to analyse reason. I tried to use _workSchedule.PrintShiftInstances()
, but exception was returned (ex. key = end.earlier.than.start). Reason for this exception was that start.CompareTo()
returned -1
if (start.CompareTo(end) < 0) { string msg = String.Format(WorkSchedule.GetMessage("end.earlier.than.start"), start, end); throw new Exception(msg); }
I used this variables as parameters for compareTo method:
LocalDate start = new LocalDate(2019, 1, 9); LocalDate end = new LocalDate(2019, 2, 28);
I also check unit testing project but testToString is disabled (I tried TestDupont)
testToString = false;
Could you help me what's wrong please?
Thank you.
The project could not be analyzed because of maven build errors. Please review the error messages here. Another build will be scheduled within 24 hours. If the build is successful this issue will be closed, otherwise the error message will be updated.
This is an automated GitHub Issue created by Sonatype DepShield. GitHub Apps, including DepShield, can be managed from the Developer settings of the repository administrators.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.