Package org.joda.time

Examples of org.joda.time.LocalDateTime


        this.title = facet.title;
        this.date = facet.date;
        this.start = facet.start;
        this.end = facet.end;

        LocalDateTime localStartTime = new LocalDateTime(facet.start, DateTimeZone.forID(facet.tz));
        startMinute = localStartTime.getHourOfDay() * 60 + localStartTime.getMinuteOfHour();
        startTime = new TimeOfDayVO(startMinute, true);

        LocalDateTime localEndTime = new LocalDateTime(facet.end, DateTimeZone.forID(facet.tz));
        endMinute = localEndTime.getHourOfDay() * 60 + localEndTime.getMinuteOfHour();
        endTime = new TimeOfDayVO(endMinute, true);

        JSONArray servingsArray = new JSONArray();
        for (JawboneUpServingFacet serving : facet.getServings()) {
            JSONObject servingJSON = JSONObject.fromObject(serving.servingDetails);
View Full Code Here


            throw new RuntimeException("Bytes " + bValue.length + " exceeds the max supported length " + DataTypeUtils.MAX_SHORT_BLOB_PROPERTY_LENGTH);
          }
          value = new ShortBlob(bValue);
        }
      } else if (type.equals(EdmSimpleType.DATETIME)) {
        LocalDateTime dValue = (LocalDateTime) value;
        if (dValue != null) {
          value = dValue.toDateTime().toDate(); // TODO review
        }
      }
      e.setProperty(prop.getName(), value);
    }
  }
View Full Code Here

        proto.string2().set( "/Foo/bar" );
        proto.number().set( 42L );
        proto.date().set( new Date() );
        proto.dateTime().set( new DateTime() );
        proto.localDate().set( new LocalDate() );
        proto.localDateTime().set( new LocalDateTime() );
        proto.entityReference().set( EntityReference.parseEntityReference( "12345" ) );
        proto.stringIntMap().get().put( "foo", 42 );

        // Can't put more than one entry in Map because this test rely on the fact that the underlying implementations
        // maintain a certain order but it's not the case on some JVMs. On OpenJDK 8 they are reversed for example.
View Full Code Here

    public void script40_LocalDateTime()
    {
        QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
        Person person = templateFor( Person.class );
        Query<Person> query = unitOfWork.newQuery( qb.where(
            eq( person.localDateTimeValue(), new LocalDateTime( "2010-03-04T13:23:00", UTC ) ) ) );
        System.out.println( "*** script40_LocalDateTime: " + query );

        verifyUnorderedResults( query, "Jack Doe" );
    }
View Full Code Here

    public void script41_LocalDateTime()
    {
        QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
        Person person = templateFor( Person.class );
        Query<Person> query = unitOfWork.newQuery( qb.where(
            ne( person.localDateTimeValue(), new LocalDateTime( "2010-03-04T13:23:00", UTC ) ) ) );
        System.out.println( "*** script41_LocalDateTime: " + query );

        verifyUnorderedResults( query, "Joe Doe" );
    }
View Full Code Here

    public void script42_LocalDateTime()
    {
        QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
        Person person = templateFor( Person.class );
        Query<Person> query = unitOfWork.newQuery( qb.where(
            ne( person.localDateTimeValue(), new LocalDateTime( "2010-03-04T13:23:00", forID( "CET" ) ) ) ) );
        System.out.println( "*** script42_LocalDateTime: " + query );

        verifyUnorderedResults( query, "Joe Doe" );
    }
View Full Code Here

    public void script43_LocalDateTime()
    {
        QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
        Person person = templateFor( Person.class );
        Query<Person> query = unitOfWork.newQuery( qb.where(
            and( gt( person.localDateTimeValue(), new LocalDateTime( "2005-03-04T13:24:35", UTC ) ),
                 lt( person.localDateTimeValue(), new LocalDateTime( "2015-03-04T13:24:35", UTC ) ) ) ) );
        System.out.println( "*** script43_LocalDateTime: " + query );

        verifyUnorderedResults( query, "Jack Doe" );
    }
View Full Code Here

        instance.booleanValue().set( Boolean.TRUE );
        instance.bigIntegerValue().set( new BigInteger( "42" ) );
        instance.bigDecimalValue().set( new BigDecimal( "42" ) );
        instance.dateValue().set( new DateTime( "2020-03-04T13:24:35", UTC ).toDate() );
        instance.dateTimeValue().set( new DateTime( "2020-03-04T13:24:35", UTC ) );
        instance.localDateTimeValue().set( new LocalDateTime( "2020-03-04T13:23:00" ) );
        instance.localDateValue().set( new LocalDate( "2020-03-04" ) );
        instance.association().set( instance );

        ValueBuilder<Tjabba> valueBuilder4 = module.newValueBuilder( Tjabba.class );
        final Tjabba prototype4 = valueBuilder4.prototype();
View Full Code Here

                        instance.dateTimeValue().get(),
                        equalTo( new DateTime( "2020-03-04T13:24:35", UTC ) ) );

            assertThat( "property 'localDateTimeValue' has correct value",
                        instance.localDateTimeValue().get(),
                        equalTo( new LocalDateTime( "2020-03-04T13:23:00", UTC ) ) );

            assertThat( "property 'localDateValue' has correct value",
                        instance.localDateValue().get(),
                        equalTo( new LocalDate( "2020-03-04" ) ) );
View Full Code Here

    @Test
    public void givenLocalDateTimeValueWhenSerializingAndDeserializingExpectEquals()
    {
        // Serialized without TimeZone
        String serialized = valueSerialization.serialize( new LocalDateTime( "2020-03-04T13:23:00", forID( "CET" ) ) );
        assertThat( serialized, equalTo( "2020-03-04T13:23:00.000" ) );

        LocalDateTime deserialized = valueSerialization.deserialize( LocalDateTime.class, serialized );
        assertThat( deserialized, equalTo( new LocalDateTime( "2020-03-04T13:23:00", UTC ) ) );
    }
View Full Code Here

TOP

Related Classes of org.joda.time.LocalDateTime

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.