Examples of toLocalDate()


Examples of org.joda.time.DateTime.toLocalDate()

    assertThat(resultMap.get("endDate")).isEqualTo(today.getMillis());
    ObjectMapper mapper = new ObjectMapper();

    Map<String, Object> expectedValue = mapper.readValue(
        mapper.writeValueAsString(today.toLocalDate()), Map.class);

    assertThat((Map<String, Object>) resultMap.get("jodaLocalDate")).isEqualTo(
        expectedValue);
    assertThat(resultMap.get("percent")).isEqualTo(0.999);
    assertThat(resultMap.get("normalParameter")).isEqualTo("normalParameter");
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDate()

    assertThat(resultMap.get("endDate")).isEqualTo(today.getMillis());
    ObjectMapper mapper = new ObjectMapper();

    Map<String, Object> expectedValue = mapper.readValue(
        mapper.writeValueAsString(today.toLocalDate()), Map.class);

    assertThat((Map<String, Object>) resultMap.get("jodaLocalDate")).isEqualTo(
        expectedValue);
    assertThat(resultMap.get("percent")).isEqualTo(0.999);
    assertThat(resultMap.get("normalParameter")).isEqualTo("normalParameter");
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDate()

        if (!result.isValid()) {
            if (result.getEnrolmentPeriod() != null) {
                DateTime now = DateTime.now().withMillisOfSecond(0);
                DateTime start = result.getEnrolmentPeriod().getStartDateDateTime();
                Period period = new Period(start.getMillis() - now.getMillis());
                if (start.toLocalDate().equals(now.toLocalDate())) {
                    request.setAttribute("now", now);
                    request.setAttribute("start", start);
                    request.setAttribute("remaining", FORMATTER.print(period));
                }
            }
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDate()

        final AcademicServiceRequestSituation activeSituation = academicServiceRequest.getActiveSituation();
        if (activeSituation != null) {
            final DateTime activeSituationDate = activeSituation.getSituationDate();
            final DateTime finalSituationDate = bean.getFinalSituationDate();
            if (finalSituationDate.toLocalDate().isBefore(activeSituationDate.toLocalDate())) {
                throw new DomainException("error.serviceRequests.AcademicServiceRequestSituation.situation.date.is.before");
            }

            if (finalSituationDate.toLocalDate().isEqual(activeSituationDate.toLocalDate())
                    && finalSituationDate.isBefore(activeSituationDate)) {
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDate()

            final DateTime finalSituationDate = bean.getFinalSituationDate();
            if (finalSituationDate.toLocalDate().isBefore(activeSituationDate.toLocalDate())) {
                throw new DomainException("error.serviceRequests.AcademicServiceRequestSituation.situation.date.is.before");
            }

            if (finalSituationDate.toLocalDate().isEqual(activeSituationDate.toLocalDate())
                    && finalSituationDate.isBefore(activeSituationDate)) {
                bean.setFinalSituationDate(activeSituationDate.plusMinutes(1));
            }
        }
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDate()

    public static LocalDate parseLocalDate(final String stringDate, final String pattern) {

        try {
            final DateTimeFormatter dateStringFormat = DateTimeFormat.forPattern(pattern);
            final DateTime dateTime = dateStringFormat.parseDateTime(stringDate);
            return dateTime.toLocalDate();
        } catch (final IllegalArgumentException e) {
            final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
            final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.date.pattern", "The parameter date ("
                    + stringDate + ") is invalid w.r.t. pattern " + pattern, "date", stringDate, pattern);
            dataValidationErrors.add(error);
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDate()

        case VALUE_STRING:
            DateTime local = parseLocal(jp);
            if (local == null) {
                return null;
            }
            return local.toLocalDate();
        }
        throw ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected JSON Array, String or Number");
    }
}
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDate()

    DateTime now = new DateTime();
    DateTime min = now.plusDays(7);
    DateTime max = now.plusMonths(1);
   
    Date minDate = min.toLocalDate().toDate();
    Date maxDate = max.toLocalDate().toDate();
   
    Set<Mother> mothers = motherDao.getMothersWithEddInRange(minDate, maxDate);
    Set<Mother>  mothersToSendReminder = new HashSet<Mother>();
   
    for (Mother mother : mothers) { 
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDate()

  public Set<Mother> getMothersToRemindOnWeek() {
    DateTime now = new DateTime();
    DateTime max = now.plusWeeks(1);
   
    Date minDate = now.toLocalDate().toDate();
    Date maxDate = max.toLocalDate().toDate();
   
    Set<Mother> mothers = motherDao.getMothersWithEddInRange(minDate, maxDate);
    Set<Mother>  mothersToSendReminder = new HashSet<Mother>();
   
    for (Mother mother : mothers) { 
View Full Code Here

Examples of org.joda.time.YearMonthDay.toLocalDate()

            if (registration.isBolonha()) {
                if (scp.getLastConcludedCycleCurriculumGroup() != null) {
                    YearMonthDay conclusionDate =
                            registration.getConclusionDate(scp.getLastConcludedCycleCurriculumGroup().getCycleType());
                    if (conclusionDate != null) {
                        return conclusionDate.toLocalDate();
                    }
                }
                return null;
            } else {
                return registration.getConclusionDate() != null ? registration.getConclusionDate().toLocalDate() : null;
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.