Examples of toDateMidnight()


Examples of org.joda.time.DateTime.toDateMidnight()

          return null;   // if there is error in patient's data return age as null
        }
        Date birthdate = patient.getBirthdate();
        DateTime today = new DateTime();
        DateTime dob = new DateTime(birthdate.getTime());
        return Days.daysBetween(dob.toDateMidnight(), today.toDateMidnight()).getDays();
    }

    /**
    *
    * @return  concept of given id
View Full Code Here

Examples of org.joda.time.DateTime.toDateMidnight()

            case VALUE_STRING:
                DateTime local = parseLocal(jp);
                if (local == null) {
                    return null;
                }
                return local.toDateMidnight();
            }
            throw ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected JSON Array, Number or String");
        }
    }
}
View Full Code Here

Examples of org.joda.time.DateTime.toDateMidnight()

                        td = timeDimensionDao.createTimeDimension(localTime);
                        times.put(localTime, td);
                    }
                   
                    //get/create DateDimension
                    final DateMidnight dateMidnight = nextDateTime.toDateMidnight();
                    DateDimension dd = dates.get(dateMidnight);
                    if (dd == null) {
                        dd = dateDimensionDao.createDateDimension(dateMidnight, 0, null);
                        dates.put(dateMidnight, dd);
                    }
View Full Code Here

Examples of org.joda.time.DateTime.toDateMidnight()

    if (startDate.isAfter(currentDate))
      throw new InvalidDateException("Virtual start date cannot be after virtual current date.");
    // got from
    // http://stackoverflow.com/questions/3802893/number-of-days-between-two-dates-in-joda-time
    int diff = Days.daysBetween(startDate.toDateMidnight(),
        currentDate.toDateMidnight()).getDays();

    return diff - game.getVirtualDaysSkipped();
  }

  /**
 
View Full Code Here

Examples of org.joda.time.DateTime.toDateMidnight()

        //Determine the ValueType of the date/time column. Use the most specific column type possible
        final ValueType dateTimeColumnType;
        if (interval.isHasTimePart()) {
            //If start/end are the same day just display the time
            if (startDateTime.toDateMidnight().equals(endDateTime.toDateMidnight())) {
                dateTimeColumnType = ValueType.TIMEOFDAY;
            }
            //interval has time data and start/end are on different days, show full date time
            else {
                dateTimeColumnType = ValueType.DATETIME;
View Full Code Here

Examples of org.joda.time.DateTime.toDateMidnight()

        }
       
        final LocalTime startTime = start.toLocalTime();
        final TimeDimension startTimeDimension = this.timeDimensionDao.getTimeDimensionByTime(startTime);

        final DateMidnight startDateMidnight = start.toDateMidnight();
        final DateDimension startDateDimension = this.dateDimensionDao.getDateDimensionByDate(startDateMidnight);
       
        return new AggregationIntervalInfo(interval, start, end, startDateDimension, startTimeDimension);
    }
View Full Code Here

Examples of org.joda.time.DateTime.toDateMidnight()

public class DatastoreUtilTest extends BaseModelTest {

    @Test
    public void testCountOverDateRange() {
        DateTime now = DateTime.now();
        Date d3 = now.toDateMidnight().toDate();
        Date d2 = now.minusDays(1).toDateMidnight().toDate()
        Date d1 = now.minusDays(2).toDateMidnight().toDate()

        DailyUsageStats s1 = new DailyUsageStats(3L, 2L, 4L, 4L, d1);
        DailyUsageStats s2 = new DailyUsageStats(3L, 2L, 4L, 4L, d2);
View Full Code Here

Examples of org.joda.time.DateTime.toDateMidnight()

            }
            DateTime whenRegistered = alumni.getRegisteredWhen();
            if (whenRegistered != null) {
                // long time =
                // whenRegistered.toLocalDate().toDateTimeAtStartOfDay().getMillis();
                long time = whenRegistered.toDateMidnight().getMillis();
                Integer count = registrationsByDay.get(time);
                registrationsByDay.put(time, count == null ? 1 : count + 1);
            }
        }
View Full Code Here

Examples of org.joda.time.DateTime.toDateMidnight()

    public String getPresentationInterval() {
        final DateTime start = interval.getStart();
        final DateTime end = interval.getEnd();
        final DateMidnight dateMidnight = start.toDateMidnight();
        if (dateMidnight.equals(end.toDateMidnight())) {
            return String.format("%s : %s as %s", dateMidnight.toString(DATE_FORMAT), getTime(start), getTime(end));
        }
        return interval.toString();
    }
View Full Code Here

Examples of org.joda.time.DateTime.toDateMidnight()

    public DateMidnight getDateDay() {
        final DateTime start = interval.getStart();
        final DateTime end = interval.getEnd();
        final DateMidnight dateMidnight = start.toDateMidnight();
        if (dateMidnight.equals(end.toDateMidnight())) {
            return dateMidnight;
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.