Fakultas Ilmu Komputer UI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MyUI-Dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
mihp26
MyUI-Dev
Merge requests
!171
sort kalendar akademis -rifki&wisnu
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
sort kalendar akademis -rifki&wisnu
task/sort-kalendar-akademis
into
develop
Overview
0
Commits
1
Pipelines
1
Changes
2
Merged
RIFKI ADRIAN
requested to merge
task/sort-kalendar-akademis
into
develop
7 years ago
Overview
0
Commits
1
Pipelines
1
Changes
2
Expand
sort kalendar akademis base on date
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
aa087411
1 commit,
7 years ago
2 files
+
21
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
app/src/main/java/id/ac/ui/cs/myui/model/calendar/CalendarItem.java
+
19
−
1
Options
package
id.ac.ui.cs.myui.model.calendar
;
import
android.support.annotation.NonNull
;
import
java.util.ArrayList
;
/**
@@ -9,7 +11,7 @@ import java.util.ArrayList;
* modified by ghozi&emon on 16/8/17
*/
public
class
CalendarItem
{
public
class
CalendarItem
implements
Comparable
<
CalendarItem
>
{
private
String
start_date
;
private
String
end_date
;
@@ -108,5 +110,21 @@ public class CalendarItem{
result
.
add
(
year
);
return
result
;
}
@Override
public
int
compareTo
(
@NonNull
CalendarItem
calendarItem
)
{
String
[]
thisStart
=
this
.
getStart_date
().
split
(
"-"
);
String
[]
thatStart
=
calendarItem
.
getStart_date
().
split
(
"-"
);
String
a
=
thisStart
[
0
]+
thisStart
[
1
]+
thisStart
[
2
];
String
b
=
thatStart
[
0
]+
thatStart
[
1
]+
thatStart
[
2
];
int
diff
=
Integer
.
parseInt
(
a
)
-
Integer
.
parseInt
(
b
);
if
(
diff
==
0
){
String
[]
thisEnd
=
this
.
getEnd_date
().
split
(
"-"
);
String
[]
thatEnd
=
calendarItem
.
getEnd_date
().
split
(
"-"
);
String
aa
=
thisEnd
[
0
]+
thisEnd
[
1
]+
thisEnd
[
2
];
String
bb
=
thatEnd
[
0
]+
thatEnd
[
1
]+
thatEnd
[
2
];
diff
=
Integer
.
parseInt
(
aa
)-
Integer
.
parseInt
(
bb
);
}
return
diff
;
}
}
Loading