Package org.joda.time

Examples of org.joda.time.DateMidnight


   *
   * @param start
   * @return
   */
  private Interval getEntireDayIntervalForDate(DateMidnight start) {
    final DateMidnight end = start.plusDays(1);
    Interval interval = new Interval(start, end);
    return interval;
  }
View Full Code Here


        return TimeUnit.DAY;
    }

    public DayMetadata(String forDate) {
        long timeForDate = TimeUtils.dateFormatterUTC.parseDateTime(forDate).getMillis();
        DateMidnight dateMidnight = new DateMidnight(timeForDate);
        start = dateMidnight.getMillis();
        end = start + DateTimeConstants.MILLIS_PER_DAY;
        this.startDate = this.endDate = this.date = forDate;
    }
View Full Code Here

  @Test
  public void testParseProjectInJira5x0() throws JSONException, URISyntaxException {
    final Project project = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/project/project-jira-5-0.json"));
    Assert.assertEquals("TST", project.getKey());
    Assert.assertEquals(new DateMidnight(2010, 8, 25).toInstant(), Iterables.getLast(project.getVersions()).getReleaseDate()
        .toInstant());
    Assert.assertEquals("Test Project", project.getName());
    final OptionalIterable<IssueType> issueTypes = project.getIssueTypes();
    Assert.assertTrue(issueTypes.isSupported());
    Assert.assertThat(issueTypes, IsIterableContainingInAnyOrder.containsInAnyOrder(
View Full Code Here

        if( deadline == null )
        {
            throw new RouteException( "Arrival deadline cannot be null." );
        }

        Date endOfToday = new DateMidnight().plusDays( 1 ).toDate();
        if( deadline.before( endOfToday ) )
        {
            throw new RouteException( "Arrival deadline is in the past or Today." +
                                        "\nDeadline           " + deadline +
                                        "\nToday (midnight)   " + endOfToday );
View Full Code Here

            if( origin == destination )
            {
                throw new CannotCreateRouteSpecificationException( "Origin location can't be same as destination location." );
            }

            Date endOfToday = new DateMidnight().plusDays( 1 ).toDate();
            if( deadline.before( endOfToday ) )
            {
                throw new CannotCreateRouteSpecificationException( "Arrival deadline is in the past or Today." +
                                                                   "\nDeadline           " + deadline +
                                                                   "\nToday (midnight)   " + endOfToday );
View Full Code Here

        "Not a multiple of %s: %s", MILLIS_PER_DAY, millis);
    return millis / MILLIS_PER_DAY;
  }

  public static DateMidnight toDateMidnightUTC(long daysSinceEpoch) {
    return new DateMidnight(daysSinceEpoch * MILLIS_PER_DAY, DateTimeZone.UTC);
  }
View Full Code Here

  private void createTestEnsemblesPuces()
  {
    EnsemblePuces ens1 = new EnsemblePuces();
    ens1.setCode("20100330-01");
    ens1.setDateDebut(new DateMidnight(2007, 3, 30).toDate());
    ens1.setNom("Ensemble de puces 1");
    ens1.setDescription("Ensemble de puces 1");

    getEnsemblePucesService().save(ens1);

    for (int i = 1; i <= 300; i++)
    {
      Puce puce = new Puce();
      puce.setCode("Puce" + i);
      puce.setNumero(i);
      puce.setEnsemblePuces(ens1);
      getPuceService().save(puce);
    }

    EnsemblePuces ens2 = new EnsemblePuces();
    ens2.setCode("ENS1");
    ens2.setDateDebut(new DateMidnight(2007, 4, 1).toDate());
    ens2.setNom("Ensemble de puces 2");
    ens2.setDescription("Ensemble de puces 2");

    getEnsemblePucesService().save(ens2);

    for (int i = 1; i <= 500; i++)
    {
      Puce puce = new Puce();
      puce.setCode("Puce" + i);
      puce.setNumero(i);
      puce.setEnsemblePuces(ens2);
      getPuceService().save(puce);
    }

    EnsemblePuces ens3 = new EnsemblePuces();
    ens3.setCode("Mini-Ensemble");
    ens3.setDateDebut(new DateMidnight(2007, 4, 1).toDate());
    ens3.setNom("Ensemble de puces 3");
    ens3.setDescription("Ensemble de puces 3");

    getEnsemblePucesService().save(ens3);

    for (int i = 1; i <= 2; i++)
    {
      Puce puce = new Puce();
      puce.setCode("Puce" + i);
      puce.setNumero(i);
      puce.setEnsemblePuces(ens3);
      getPuceService().save(puce);
    }

    EnsemblePuces ens4 = new EnsemblePuces();
    ens4.setCode("Ensemble Expiré");
    ens4.setDateDebut(new DateMidnight(2006, 4, 1).toDate());
    ens4.setDateFin(new DateMidnight(2007, 4, 1).toDate());
    ens4.setNom("Ensemble de puces 4");
    ens4.setDescription("Ensemble de puces 4");

    getEnsemblePucesService().save(ens4);
View Full Code Here

      @Override
      public void onClick()
      {
        EnsemblePuces newEnsemblePuces = ensemblePucesService
            .newEnsemblePuces(new DateMidnight().toDate());
        setResponsePage(new EnsemblePucesUpdatePage(newEnsemblePuces));
      }
    });

    add(new EnsemblePucesDataViewPanel("ensemblePuces",
View Full Code Here

  }

  public void testNewCode() throws Exception
  {
    assertEquals("20100329-01", ensemblePucesService
        .newCode(new DateMidnight(2010, 3, 29).toDate()));
  }
View Full Code Here

  }

  public void testNewCodeAvecExistant() throws Exception
  {
    assertEquals("20100330-02", ensemblePucesService
        .newCode(new DateMidnight(2010, 3, 30).toDate()));
  }
View Full Code Here

TOP

Related Classes of org.joda.time.DateMidnight

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.