Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Date creationTime = blockSupplier.getModel(ctx).getMediaTopic().getCreated();
- long creationTimeMs = creationTime != null ? creationTime.getTime() : System.currentTimeMillis();
- long anniversaryTime = blockSupplier.getModel(ctx).getAnniversaryTime();
- Calendar friendshipCalendar = Calendar.getInstance();
- friendshipCalendar.setTimeInMillis(916210800000L);
- int friendshipMonth = friendshipCalendar.get(Calendar.MONTH);
- int friendshipDay = friendshipCalendar.get(Calendar.DAY_OF_MONTH);
- int friendshipYear = friendshipCalendar.get(Calendar.YEAR);
- Calendar currentCalendar = Calendar.getInstance();
- currentCalendar.setTimeInMillis(1231822800000L);
- int currentMonth = currentCalendar.get(Calendar.MONTH);
- int currentDay = currentCalendar.get(Calendar.DAY_OF_MONTH);
- int currentYear = currentCalendar.get(Calendar.YEAR);
- int diff = currentYear - friendshipYear;
- if (currentMonth < friendshipMonth || (currentMonth == friendshipMonth && currentDay < friendshipDay)) {
- diff--;
- }
- return diff;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement