Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmpt-370-group-project-group26
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eyan Cunningham (esc568)
cmpt-370-group-project-group26
Commits
7b31c261
Commit
7b31c261
authored
3 years ago
by
Rafi
Browse files
Options
Downloads
Patches
Plain Diff
Made changes to the constructor class so parsing is done here, and that the date is also stored.
parent
baa36d72
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Changed update implementation for employees so rather than sending the whole...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SchedulerApp/src/main/java/com/example/schedulerapp/Shift.java
+21
-6
21 additions, 6 deletions
...ulerApp/src/main/java/com/example/schedulerapp/Shift.java
with
21 additions
and
6 deletions
SchedulerApp/src/main/java/com/example/schedulerapp/Shift.java
+
21
−
6
View file @
7b31c261
package
com.example.schedulerapp
;
package
com.example.schedulerapp
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
public
class
Shift
{
public
class
Shift
{
private
int
EmployeeID
;
private
int
EmployeeID
;
private
String
date
;
private
LocalDateTime
start
;
private
LocalDateTime
start
;
private
LocalDateTime
end
;
private
LocalDateTime
end
;
private
boolean
available
;
private
boolean
available
;
private
int
shiftID
;
private
int
shiftID
;
//todo: error checking on start/end? (end cannot be before start)
//todo: error checking on start/end? (end cannot be before start)
public
Shift
(
int
EmpID
,
LocalDateTime
start
,
LocalDateTime
end
,
int
shiftID
){
public
Shift
(
String
shiftData
){
this
.
EmployeeID
=
EmpID
;
try
{
this
.
start
=
start
;
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-ddHHmm"
);
this
.
end
=
end
;
String
[]
dataSplit
=
shiftData
.
split
(
"\\."
);
this
.
available
=
false
;
this
.
EmployeeID
=
Integer
.
parseInt
(
dataSplit
[
0
]);
this
.
shiftID
=
shiftID
;
this
.
shiftID
=
Integer
.
parseInt
(
dataSplit
[
4
]);
if
(
dataSplit
[
2
].
length
()
==
3
)
dataSplit
[
2
]
=
"0"
+
dataSplit
[
2
];
if
(
dataSplit
[
3
].
length
()
==
3
)
dataSplit
[
3
]
=
"0"
+
dataSplit
[
3
];
this
.
start
=
LocalDateTime
.
parse
(
dataSplit
[
1
]
+
dataSplit
[
2
],
formatter
);
this
.
end
=
LocalDateTime
.
parse
(
dataSplit
[
1
]
+
dataSplit
[
3
],
formatter
);
this
.
date
=
dataSplit
[
1
];
this
.
available
=
false
;
}
catch
(
Exception
exception
)
{
exception
.
printStackTrace
();
}
}
}
public
int
getEmployeeID
()
{
public
int
getEmployeeID
()
{
...
@@ -30,6 +41,10 @@ public class Shift {
...
@@ -30,6 +41,10 @@ public class Shift {
return
end
;
return
end
;
}
}
public
String
getDate
()
{
return
date
;
}
public
boolean
isAvailable
()
{
public
boolean
isAvailable
()
{
return
available
;
return
available
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment