Examples of LocalDate


Examples of com.facebook.presto.jdbc.internal.joda.time.LocalDate

                jp.nextToken(); // VALUE_NUMBER_INT
                int day = jp.getIntValue();
                if (jp.nextToken() != JsonToken.END_ARRAY) {
                    throw ctxt.wrongTokenException(jp, JsonToken.END_ARRAY, "after LocalDate ints");
                }
                return new LocalDate(year, month, day);
            }
            break;
        case VALUE_NUMBER_INT:
            return new LocalDate(jp.getLongValue());           
        case VALUE_STRING:
            String str = jp.getText().trim();
            if (str.length() == 0) { // [JACKSON-360]
                return null;
            }
View Full Code Here

Examples of java.time.LocalDate

    @Override
    public void start(Stage stage) throws Exception {
        /*
         * Properties of any type can be easily injected.
         */
        LocalDate date = LocalDate.of(4242, Month.JULY, 21);
        Map<Object, Object> customProperties = new HashMap<>();
        customProperties.put("date", date);
        /*
         * any function which accepts an Object as key and returns
         * and return an Object as result can be used as source.
View Full Code Here

Examples of javax.time.calendar.LocalDate

     * Converts this date to an ISO-8601 calendar system {@code LocalDate}.
     *
     * @return the equivalent date in the ISO-8601 calendar system, never null
     */
    public LocalDate toLocalDate() {
        LocalDate possible = LocalDate.of(year, month, day);
        if (possible.isBefore(chrono.getCutover())) {
            long julYear1Days = (year - 1) * 365 + (year / 4) + chrono.getDayOfYear(this) - 1;
            return LocalDate.fromModifiedJulianDays(julYear1Days + 0)// TODO
        } else {
            return possible;
        }
View Full Code Here

Examples of org.elasticsearch.common.joda.time.LocalDate

                Set<String> toClose = new HashSet<>();
                Set<String> toDelete = new HashSet<>();

                // Compute things to do
                LocalDate now = new LocalDate();
                for (ObjectObjectCursor<String, IndexMetaData> it : state.getState().metaData().indices()) {
                    String index = it.value.getIndex();
                    Matcher matcher = pattern.matcher(index);

                    if (matcher.find()) {
                        LocalDate date = new LocalDate(Integer.parseInt(matcher.group(1)),
                                Integer.parseInt(matcher.group(2)),
                                Integer.parseInt(matcher.group(3)));

                        int daysOld = Days.daysBetween(date, now).getDays();
                        if (daysOld > 0 && daysOpened > 0 && daysOld > daysOpened) {
View Full Code Here

Examples of org.formulacompiler.compiler.internal.LocalDate

      }
      else if (constantValue instanceof Date) {
        throw new IllegalArgumentException( "Saving dates is not supported." );
      }
      else if (constantValue instanceof LocalDate) {
        final LocalDate localDate = (LocalDate) constantValue;
        _stringBuilder.append( localDate.doubleValue() );
      }
      else if (constantValue instanceof Duration) {
        final Duration duration = (Duration) constantValue;
        _stringBuilder.append( duration.doubleValue() );
      }
View Full Code Here

Examples of org.joda.time.LocalDate

     */
    public static LocalDate deserializeLocalDate(String text) throws JiBXException {
        if (text == null) {
            return null;
        } else {
            return new LocalDate(Utility.parseDate(text), DateTimeZone.UTC);
        }
    }
View Full Code Here

Examples of org.joda.time.LocalDate

        DateTimeZone.setDefault(DateTimeZone.forOffsetHours(OFFSET_HOURS));
    }

    public void testDeserializeLocalDate() throws JiBXException {
        assertNull("Null input", JodaConvert.deserializeLocalDate(null));
        LocalDate date = JodaConvert.deserializeLocalDate("2008-02-28");
        assertEquals("Wrong value", 2008, date.getYear());
        assertEquals("Wrong value", 2, date.getMonthOfYear());
        assertEquals("Wrong value", 28, date.getDayOfMonth());
        date = JodaConvert.deserializeLocalDate("2008-02-29Z");
        assertEquals("Wrong value", 2008, date.getYear());
        assertEquals("Wrong value", 2, date.getMonthOfYear());
        assertEquals("Wrong value", 29, date.getDayOfMonth());
        date = JodaConvert.deserializeLocalDate("2008-02-29-24:00");
        assertEquals("Wrong value", 2008, date.getYear());
        assertEquals("Wrong value", 2, date.getMonthOfYear());
        assertEquals("Wrong value", 29, date.getDayOfMonth());
        try {
            JodaConvert.deserializeUTCDateTime("2007-02-29");
            fail("Invalid day number");
        } catch (JiBXException ex) {}
        try {
View Full Code Here

Examples of org.joda.time.LocalDate

            fail("Invalid month number");
        } catch (JiBXException ex) {}
    }
   
    public void testSerializeLocalDate() throws JiBXException {
        assertEquals("2008-02-28", JodaConvert.serializeLocalDate(new LocalDate(2008, 2, 28)));
        assertEquals("2008-02-29", JodaConvert.serializeLocalDate(new LocalDate(2008, 2, 29)));
        assertEquals("2008-03-01", JodaConvert.serializeLocalDate(new LocalDate(2008, 3, 1)));
    }
View Full Code Here

Examples of org.joda.time.LocalDate

    //-----------------------------------------------------------------------
    private static final Chronology GJ_CHRONOLOGY = GJChronology.getInstanceUTC();

    //-----------------------------------------------------------------------
    public void test_plusYears_positiveToPositive() {
        LocalDate date = new LocalDate(3, 6, 30, GJ_CHRONOLOGY);
        LocalDate expected = new LocalDate(7, 6, 30, GJ_CHRONOLOGY);
        assertEquals(expected, date.plusYears(4));
    }
View Full Code Here

Examples of org.joda.time.LocalDate

        LocalDate expected = new LocalDate(7, 6, 30, GJ_CHRONOLOGY);
        assertEquals(expected, date.plusYears(4));
    }

    public void test_plusYears_positiveToZero() {
        LocalDate date = new LocalDate(3, 6, 30, GJ_CHRONOLOGY);
        LocalDate expected = new LocalDate(-1, 6, 30, GJ_CHRONOLOGY);
        assertEquals(expected, date.plusYears(-3));
    }
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.