Examples of JodaDateTime


Examples of org.jboss.dna.graph.properties.basic.JodaDateTime

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("Contribution from \"");
        sb.append(getSourceName());
        if (isExpired(new JodaDateTime().toUtcTimeZone())) {
            sb.append("\": expired ");
        } else {
            sb.append("\": expires ");
        }
        sb.append(getExpirationTimeInUtc().getString());
View Full Code Here

Examples of org.jboss.dna.graph.properties.basic.JodaDateTime

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("Contribution from \"");
        sb.append(getSourceName());
        if (isExpired(new JodaDateTime().toUtcTimeZone())) {
            sb.append("\": expired ");
        } else {
            sb.append("\": expires ");
        }
        sb.append(getExpirationTimeInUtc().getString());
View Full Code Here

Examples of org.jboss.dna.graph.property.basic.JodaDateTime

            return valueFactories.getDateFactory();
        }

        @Override
        protected Comparable<DateTime> parseValue( String s ) {
            return new JodaDateTime(s.trim());
        }
View Full Code Here

Examples of org.jboss.dna.graph.property.basic.JodaDateTime

     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "" + numChanges + " changes by " + username + " at " + new JodaDateTime(timestampInUtc);
    }
View Full Code Here

Examples of org.jboss.dna.graph.property.basic.JodaDateTime

            return valueFactories.getDateFactory();
        }

        @Override
        protected Comparable<DateTime> parseValue( String s ) {
            return new JodaDateTime(s.trim());
        }
View Full Code Here

Examples of org.jboss.dna.graph.property.basic.JodaDateTime

        iso8601instance = "2008-05-10T13:22:04.678";
    }

    @Test
    public void shouldConstructWithIso8601FormattedStringWithoutZone() {
        instant = new JodaDateTime(iso8601instance, "UTC");
        assertThat(instant.getString(), startsWith(iso8601instance));
        assertThat(instant.getYearOfCentury(), is(8));
        assertThat(instant.getYear(), is(2008));
        assertThat(instant.getMonthOfYear(), is(5));
        assertThat(instant.getDayOfMonth(), is(10));
View Full Code Here

Examples of org.jboss.dna.graph.property.basic.JodaDateTime

    }

    @Test
    public void shouldConstructWithIso8601FormattedString() {
        iso8601instance = "2008-05-10T13:22:04.678-04:00";
        instant = new JodaDateTime(iso8601instance);
        instant = (JodaDateTime)instant.toTimeZone("UTC");
        assertThat(instant.getString(), is("2008-05-10T17:22:04.678Z"));
        assertThat(instant.getYearOfCentury(), is(8));
        assertThat(instant.getYear(), is(2008));
        assertThat(instant.getMonthOfYear(), is(5));
View Full Code Here

Examples of org.modeshape.jcr.value.basic.JodaDateTime

        Property decimalProp = node1.getProperty("decimal_prop");
        assertEquals(BigDecimal.valueOf(12.3), decimalProp.getDecimal());
        assertEquals(javax.jcr.PropertyType.DECIMAL, decimalProp.getType());

        Property dateProp = node1.getProperty("date_prop");
        assertEquals(new JodaDateTime("1994-11-05T13:15:30Z").toCalendar(), dateProp.getDate());
        assertEquals(javax.jcr.PropertyType.DATE, dateProp.getType());

        Property doubleProp = node1.getProperty("double_prop");
        assertEquals(12.3, doubleProp.getDouble(), 0);
        assertEquals(javax.jcr.PropertyType.DOUBLE, doubleProp.getType());
View Full Code Here

Examples of org.modeshape.jcr.value.basic.JodaDateTime

    protected final static class DateCanonicalizer implements Canonicalizer {
        @Override
        public Object canonicalizeValue( Object value ) {
            if (value instanceof DateTime) return value;
            if (value instanceof Calendar) {
                return new JodaDateTime((Calendar)value);
            }
            if (value instanceof Date) {
                return new JodaDateTime((Date)value);
            }
            return value;
        }
View Full Code Here

Examples of org.modeshape.jcr.value.basic.JodaDateTime

        private String journalId;

        private TestChangeSet( List<Change> changes,
                               String journalId ) {
            this.changes = changes;
            this.timestamp = new JodaDateTime();
            this.journalId = journalId;
        }
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.