Package org.apache.isis.applib.value

Examples of org.apache.isis.applib.value.DateTime


        // assertEquals("21-May-2007 10:30", adapter.titleString(null));
    }

    private void assertEntry(final String entry, final int year, final int month, final int day, final int hour, final int minute, final int second) {
        final Object object = adapter.parseTextEntry(null, entry, null);
        assertEquals(new DateTime(year, month, day, hour, minute, second), object);
    }
View Full Code Here


        super(holder, DateTime.class, Immutability.NOT_IMMUTABLE, EqualByContent.NOT_HONOURED, configuration, context);
    }

    @Override
    protected Date dateValue(final Object value) {
        final DateTime date = (DateTime) value;
        return date == null ? null : date.dateValue();
    }
View Full Code Here

        return date == null ? null : date.dateValue();
    }

    @Override
    protected DateTime add(final DateTime original, final int years, final int months, final int days, final int hours, final int minutes) {
        DateTime date = original;
        date = date.add(years, months, days, hours, minutes);
        return date;
    }
View Full Code Here

        return date;
    }

    @Override
    protected DateTime now() {
        return new DateTime();
    }
View Full Code Here

        return new DateTime();
    }

    @Override
    protected DateTime setDate(final Date date) {
        return new DateTime(date);
    }
View Full Code Here

   
    // {{ Timestamp (property)
    @Title(sequence="1")
    @MemberOrder(sequence = "1")
    public DateTime getTimestamp() {
        return timestampEpoch != null? new DateTime(timestampEpoch): null;
    }
View Full Code Here

    }
   
    @Test
    public void roundtripWhenParsingDateFormat() {
        final DateConverterForApplibDateTime converter = new DateConverterForApplibDateTime(settings, 0);
        final DateTime dt = converter.convertToObject("2013-05-11", null);
        assertThat(dt, is(new DateTime(2013, 05, 11, 0, 0)));
       
        final String str = converter.convertToString(dt, null);
        assertThat(str, is("2013-05-11 00:00"));
    }
View Full Code Here

    }
   
    @Test
    public void roundtripWhenParsingDateTimeFormat() {
        final DateConverterForApplibDateTime converter = new DateConverterForApplibDateTime(settings, 0);
        final DateTime dt = converter.convertToObject("2013-05-11 00:00", null);
        assertThat(dt, is(new DateTime(2013, 05, 11, 0, 0)));
       
        final String str = converter.convertToString(dt, null);
        assertThat(str, is("2013-05-11 00:00"));
    }
View Full Code Here

    }
   
    @Test
    public void roundtripWhenParsingDateFormatWithAdjustBy() {
        final DateConverterForApplibDateTime converter = new DateConverterForApplibDateTime(settings, -1);
        final DateTime dt = converter.convertToObject("2013-05-11", null);
        assertThat(dt, is(new DateTime(2013, 05, 12, 0, 0)));
       
        final String str = converter.convertToString(dt, null);
        assertThat(str, is("2013-05-11 00:00"));
    }
View Full Code Here

    }

    @Test
    public void roundtripWhenParsingDateTimeFormatWithAdjustBy() {
        final DateConverterForApplibDateTime converter = new DateConverterForApplibDateTime(settings, -1);
        final DateTime dt = converter.convertToObject("2013-05-11 00:00", null);
        assertThat(dt, is(new DateTime(2013, 05, 12, 0, 0)));
       
        final String str = converter.convertToString(dt, null);
        assertThat(str, is("2013-05-11 00:00"));
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.applib.value.DateTime

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.