Package org.joda.time

Examples of org.joda.time.DateMidnight


    final void doUpdateDateDimensions() {
        final List<DateDimension> dateDimensions = this.dateDimensionDao.getDateDimensionsWithoutTerm();
        final List<AcademicTermDetail> academicTermDetails = this.eventAggregationManagementDao.getAcademicTermDetails();
       
        for (final DateDimension dateDimension : dateDimensions) {
            final DateMidnight date = dateDimension.getDate();
            final AcademicTermDetail termDetail = EventDateTimeUtils.findDateRangeSorted(date, academicTermDetails);
            if (termDetail != null) {
                dateDimension.setTerm(termDetail.getTermName());
                this.dateDimensionDao.updateDateDimension(dateDimension);
            }
View Full Code Here


        return this.id;
    }
   
    @Override
    public DateMidnight getDate() {
        DateMidnight dm = this.dateMidnight;
        if (dm == null) {
            dm = this.date.toDateMidnight();
            this.dateMidnight = dm;
        }
       
View Full Code Here

    }
   
   
    @Override
    public int compareTo(ReadableInstant instant) {
        final DateMidnight startDateTime = this.getStartDateMidnight(instant);
        final DateMidnight endDateTime = this.getEndDateMidnight(instant);
       
        return EventDateTimeUtils.compareTo(startDateTime, endDateTime, instant);
    }
View Full Code Here

        //Set academic term if configured
        final List<AcademicTermDetail> academicTerms = Lists.transform(data.getTermDetails(), new Function<ExternalTermDetail, AcademicTermDetail>() {
            public AcademicTermDetail apply(ExternalTermDetail externalTermDetail) {
                return new AcademicTermDetailImpl(
                    new DateMidnight(externalTermDetail.getStart()),
                    new DateMidnight(externalTermDetail.getEnd()),
                    externalTermDetail.getName());
            }
        });
        this.aggregationManagementDao.setAcademicTermDetails(academicTerms);
  }
View Full Code Here

        private DateTime dateTime;
        private Period period;

        public TestEvent(String name) {
            this.name = name;
            this.date = new DateMidnight();
            this.dateTime = new DateTime();
            this.period = new Period(100);
        }
View Full Code Here

        private DateTime dateTime;
        private Period period;

        public TestEvent(String name) {
            this.name = name;
            this.date = new DateMidnight();
            this.dateTime = new DateTime();
            this.period = new Period(100);
            this.someListOfString = new ArrayList<String>();
            someListOfString.add("First");
            someListOfString.add("Second");
View Full Code Here

    @Test
    public void testCurrentDate()
            throws Exception
    {
        // current date is the time at midnight in the session time zone
        DateMidnight dateMidnight = new DateMidnight(session.getStartTime(), DateTimeZone.UTC).withZoneRetainFields(DATE_TIME_ZONE);
        assertFunction("CURRENT_DATE", toDate(dateMidnight.getMillis()));
    }
View Full Code Here

                interval = AggregationInterval.FIVE_MINUTE;
                break;
            }
            case TODAY:
            {
                begin = new DateMidnight().toDateTime();
                end = begin.plusDays(1);
                interval = AggregationInterval.DAY;
                break;
            }
            case YESTERDAY:
            {
                end = new DateMidnight().toDateTime().minusSeconds(1);
                begin = end.minusDays(1);
                interval = AggregationInterval.DAY;
                break;
            }
            default:
View Full Code Here

    if (applyTimeZoneDifference)
    {
      TimeZone zone = getClientTimeZone();
      // instantiate now/ current time
      MutableDateTime dt = new MutableDateTime(new DateMidnight());
      if (zone != null)
      {
        // set time zone for client
        format = format.withZone(DateTimeZone.forTimeZone(zone));
        dt.setZone(DateTimeZone.forTimeZone(zone));
View Full Code Here

            throws IOException, JsonProcessingException
        {
            // We'll accept either long (timestamp) or array:
            switch (jp.getCurrentToken()) {
            case VALUE_NUMBER_INT:
                return new DateMidnight(jp.getLongValue());           
            case VALUE_STRING:
                return parseLocal(jp).toDateMidnight();
            case START_ARRAY:
                jp.nextToken(); // VALUE_NUMBER_INT
                int year = jp.getIntValue();
                jp.nextToken(); // VALUE_NUMBER_INT
                int month = jp.getIntValue();
                jp.nextToken(); // VALUE_NUMBER_INT
                int day = jp.getIntValue();
                if (jp.nextToken() != JsonToken.END_ARRAY) {
                    ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected END_ARRAY after DateMidnight ints");
                }
                return new DateMidnight(year, month, day);
            }
            ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected JSON Array, Number or String");
            return null;
        }
View Full Code Here

TOP

Related Classes of org.joda.time.DateMidnight

Copyright © 2018 www.massapicom. 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.