Package org.joda.time

Examples of org.joda.time.LocalTime


    public HoursWorkedPerResourceDTO(Resource resource,
            WorkReportLine workReportLine) {

        this.workerName = resource.getName();
        this.date = workReportLine.getDate();
        LocalTime clockStart = workReportLine.getClockStart();
        this.clockStart = (clockStart != null) ? clockStart.toString("HH:mm")
                : "";
        LocalTime clockFinish = workReportLine.getClockFinish();
        this.clockFinish = (clockFinish != null) ? clockFinish
                .toString("HH:mm") : "";
        this.effort = workReportLine.getEffort();
        this.orderElementCode = workReportLine.getOrderElement().getCode();
        this.orderElementName = workReportLine.getOrderElement().getName();
        this.descriptionValues = descriptionValuesAsString(workReportLine.getDescriptionValues());
View Full Code Here


        workReport.addWorkReportLine(workReportLine);

        workReportLine.setEffort(EffortDuration.hours(10));
        assertNull(workReportLine.getEffort());

        LocalTime start = new LocalTime(8, 0);
        LocalTime end = start.plusHours(8);

        workReportLine.setClockStart(start);
        workReportLine.setClockFinish(end);

        assertThat(workReportLine.getEffort(), equalTo(EffortDuration.hours(8)));
View Full Code Here

        WorkReportLine workReportLine = givenBasicWorkReportLine(workReport);
        workReport.addWorkReportLine(workReportLine);

        workReportLine.setEffort(EffortDuration.hours(10));
        LocalTime start = new LocalTime(8, 0);
        LocalTime end = start.plusHours(8);

        workReportLine.setClockStart(start);
        workReportLine.setClockFinish(end);

        assertThat(workReportLine.getEffort(), equalTo(EffortDuration.hours(8)));
View Full Code Here

        earliestDate = newEarliestDate;

        // Input field validation - date should be _after_ minimumDate (not the same)
        LocalDate minimumDate = newEarliestDate.minusDays( 1 );
        Date convertedMinimumDate = new DateTime( minimumDate.toDateTime( new LocalTime() ) ).toDate();
        add( DateValidator.minimum( convertedMinimumDate ) );

        return this;
    }
View Full Code Here

                        destination = locationList.get( random.nextInt( locationSize ) );
                    }
                    while( destination.equals( origin ) );

                    deadline = new LocalDate().plusDays( 35 + random.nextInt( 10 ) )
                        .toDateTime( new LocalTime() )
                        .toDate();

                    // Build sortable random tracking ids
                    uuid = UUID.randomUUID().toString().toUpperCase();
                    id = ( i + 11 ) + "-" + uuid.substring( 0, uuid.indexOf( "-" ) );
View Full Code Here

        earliestDate = newEarliestDate;

        // Input field validation - date should be _after_ minimumDate (not the same)
        LocalDate minimumDate = newEarliestDate.minusDays( 1 );
        Date convertedMinimumDate = new DateTime( minimumDate.toDateTime( new LocalTime() ) ).toDate();
        add( DateValidator.minimum( convertedMinimumDate ) );

        return this;
    }
View Full Code Here

                        destination = locationList.get( random.nextInt( locationSize ) );
                    }
                    while( destination.equals( origin ) );

                    deadline = new LocalDate().plusDays( 15 + random.nextInt( 10 ) )
                        .toDateTime( new LocalTime() )
                        .toDate();

                    // Build sortable random tracking ids
                    uuid = UUID.randomUUID().toString().toUpperCase();
                    id = ( i + 11 ) + "-" + uuid.substring( 0, uuid.indexOf( "-" ) );
View Full Code Here

  public void shouldBeAbleToConvert() {
    when(request.getAttribute("javax.servlet.jsp.jstl.fmt.locale.request"))
      .thenReturn("pt_br");

    assertThat(converter.convert("15:38", LocalTime.class, bundle),
        is(equalTo(new LocalTime(15, 38))));
  }
View Full Code Here

    }

    @Test
    public void testLocalTimeToString() {
        Source src = new Source();
        src.setLocalTime( new LocalTime( 0, 0 ) );
        Target target = SourceTargetMapper.INSTANCE.sourceToTargetLocalTimeMapped( src );
        assertThat( target ).isNotNull();
        assertThat( target.getLocalTime() ).isEqualTo( "00:00" );
    }
View Full Code Here

    }

    @Test
    public void testSourceToTargetMappingForStrings() {
        Source src = new Source();
        src.setLocalTime( new LocalTime( 0, 0 ) );
        src.setLocalDate( new LocalDate( 2014, 1, 1 ) );
        src.setLocalDateTime( new LocalDateTime( 2014, 1, 1, 0, 0 ) );
        src.setDateTime( new DateTime( 2014, 1, 1, 0, 0, 0, DateTimeZone.UTC ) );

        // with given format
View Full Code Here

TOP

Related Classes of org.joda.time.LocalTime

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.