コード例 #1
0
 public void setCurrentPoint(Calendar current) {
   currentPoint = (Calendar) current.clone();
   zeroDate(currentPoint);
   long difference = currentPoint.getTimeInMillis() - startPoint.getTimeInMillis();
   int days = (int) (difference / (1000L * 3600L * 24L));
   int weeks = days / Age.DAYS_IN_WEEK;
   days = days - weeks * Age.DAYS_IN_WEEK;
   try {
     if (age == null) {
       age = new Age(weeks, days);
     } else {
       age.setDays(days);
       age.setWeeks(weeks);
     }
   } catch (Exception e) {
     age = null;
   }
 }