Skip to content
Snippets Groups Projects
Commit be4f4e02 authored by ArktikHunter's avatar ArktikHunter
Browse files

Merge branch 'main' of git.cs.usask.ca:esc568/cmpt-370-group-project into main

parents 151a2816 f7a12fad
No related branches found
No related tags found
No related merge requests found
......@@ -265,8 +265,33 @@ public class Model {
return output;
}
//todo
void getEmployeeShiftsByWeek(){
ArrayList<String> getEmployeeShiftsByWeek(int employeeID, String startOfWeek, String endOfWeek){
String[] startSplit = startOfWeek.split("-");
String[] endSplit = endOfWeek.split("-");
ArrayList<String> output = new ArrayList<>();
for(String shift: this.shifts){
if(!shift.equals("allShifts")){
String[] shiftSplit = shift.split("\\.");
String[] dateSplit = shiftSplit[1].split("-");
try {
if(Integer.parseInt(shiftSplit[0]) == employeeID){
if(Integer.parseInt(startSplit[0]) >= Integer.parseInt(dateSplit[0]) &&
Integer.parseInt(startSplit[1]) >= Integer.parseInt(dateSplit[1]) &&
Integer.parseInt(startSplit[2]) >= Integer.parseInt(dateSplit[2])){
if(Integer.parseInt(endSplit[0]) >= Integer.parseInt(dateSplit[0]) &&
Integer.parseInt(endSplit[1]) >= Integer.parseInt(dateSplit[1]) &&
Integer.parseInt(endSplit[2]) >= Integer.parseInt(dateSplit[2])){
output.add(shift);
}
}
}
} catch (Exception e){
System.out.println("Error: Parsing string to int");
}
}
}
return output;
}
void logOut() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment