Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
- int ind1 = 0,ind2 = 0;
- for(int i=0;i<12;i++) {
- if(monthArray[i].equalsIgnoreCase(month)) {
- ind1=i;
- }
- if(monthArray[i].equalsIgnoreCase(app.getMonth())) {
- ind2=i;
- }
- }
- if(ind1<ind2) {
- return 1;
- }
- else if(ind1==ind2) {
- if(this.day<app.getDay()) {
- return 1;
- }
- else if(this.getDay()>app.getDay()) {
- return -1;
- }
- else {
- if(this.getHour()<app.getHour()) {
- return 1;
- }
- else if(this.getHour()>app.getHour()) {
- return -1;
- }
- else {
- if(this.getMin()<app.getMin()) {
- return 1;
- }
- else if(this.getMin()>app.getMin()) {
- return -1;
- }
- else {
- return 0;
- }
- }
- }
- }
- else {
- return -1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement