Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
  2. int ind1 = 0,ind2 = 0;
  3. for(int i=0;i<12;i++) {
  4. if(monthArray[i].equalsIgnoreCase(month)) {
  5. ind1=i;
  6. }
  7. if(monthArray[i].equalsIgnoreCase(app.getMonth())) {
  8. ind2=i;
  9. }
  10. }
  11. if(ind1<ind2) {
  12. return 1;
  13. }
  14. else if(ind1==ind2) {
  15. if(this.day<app.getDay()) {
  16. return 1;
  17. }
  18. else if(this.getDay()>app.getDay()) {
  19. return -1;
  20. }
  21. else {
  22. if(this.getHour()<app.getHour()) {
  23. return 1;
  24. }
  25. else if(this.getHour()>app.getHour()) {
  26. return -1;
  27. }
  28. else {
  29. if(this.getMin()<app.getMin()) {
  30. return 1;
  31. }
  32. else if(this.getMin()>app.getMin()) {
  33. return -1;
  34. }
  35. else {
  36. return 0;
  37. }
  38. }
  39. }
  40. }
  41. else {
  42. return -1;
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement