Package org.joda.time

Examples of org.joda.time.LocalDate


    // EncoderDecoder
    // //////////////////////////////////////////////////////////////////

    @Override
    protected String doEncode(final Object object) {
        final LocalDate date = (LocalDate) object;
        return encode(date);
    }
View Full Code Here


   
    private LocalDate someLocalDate;
   
    @Before
    public void setUp() throws Exception {
        someLocalDate = new LocalDate(2012,4,1);
       
        strSetting = new SettingAbstractForTesting("strSetting", "ABC", SettingType.STRING);
        intSetting = new SettingAbstractForTesting("intSetting", "" + Integer.MAX_VALUE, SettingType.INT);
        localDateSetting = new SettingAbstractForTesting("localDateSetting", someLocalDate.toString(SettingAbstract.DATE_FORMATTER), SettingType.LOCAL_DATE);
        longSetting = new SettingAbstractForTesting("longSetting", ""+Long.MAX_VALUE, SettingType.LONG);
View Full Code Here

    @Test
    public void defaultEventType() throws Exception {
       
        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "someDateProperty");
        LocalDate oldValue = new LocalDate(2013,4,1);
        LocalDate newValue = new LocalDate(2013,5,2);
       
        final PropertyChangedEvent<Object, Object> ev =
                PostsPropertyChangedEventSetterFacet.Util.newEvent(PropertyChangedEvent.Default.class, sdo, identifier, oldValue, newValue);
        assertThat(ev.getSource(), is((Object)sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

    @Test
    public void customEventType() throws Exception {

        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "someDateProperty");
        LocalDate oldValue = new LocalDate(2013,4,1);
        LocalDate newValue = new LocalDate(2013,5,2);
       
        final PropertyChangedEvent<SomeDomainObject, LocalDate> ev =
                PostsPropertyChangedEventSetterFacet.Util.newEvent(SomeDatePropertyChangedEvent.class, sdo, identifier, oldValue, newValue);
        assertThat(ev.getSource(), is(sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

  }

  private boolean isTransactionWithinRange(Transaction pTransaction, LocalDate pFromDate,
      LocalDate pToDate) {
    LocalDate transactionDate = pTransaction.getTransactionDate();
    return (pFromDate == null || pFromDate.equals(transactionDate) || pFromDate
        .isBefore(transactionDate))
        && (pToDate == null || pToDate.equals(transactionDate) || pToDate.isAfter(transactionDate));
  }
View Full Code Here

    Transaction transaction = new Transaction();
    transaction.setAmount(new BigDecimal(1234));
    transaction.setDescription("Insättning");
    transaction.setPending(false);
    transaction.setCurrency(Currency.getInstance("SEK"));
    transaction.setTransactionDate(new LocalDate("2014-01-27"));
    return transaction;
  }
View Full Code Here

    Transaction transaction = new Transaction();
    transaction.setAmount(new BigDecimal(-123));
    transaction.setCurrency(Currency.getInstance("SEK"));
    transaction.setDescription("Innehållen kapitalskatt 2013");
    transaction.setPending(false);
    transaction.setTransactionDate(new LocalDate("2013-12-31"));
    return transaction;

  }
View Full Code Here

    return pagination;
  }

  private boolean isDateWithinRange(Element elem) {
    String fromDateString = elem.text().substring(0, elem.text().indexOf("till")).trim();
    LocalDate toDate = LocalDate.now();
    if (!"0".equals(elem.val())) {
      String toDateString = elem.text().substring(fromDateString.length() + 5).trim();
      toDate = DATE_FORMATTER.parseLocalDate(toDateString);
    }
    return mToDateTime == null ? true : mFromDateTime.isBefore(toDate);
View Full Code Here

            .setDescription(vTransaction.getAmount().compareTo(BigDecimal.ZERO) > 0 ? "Insättning"
                : "Uttag");
      }
      vTransaction.setCurrency(Currency.getInstance("SEK"));

      vTransaction.setTransactionDate(new LocalDate(vTransactionElement.first().text()));
      vTransactions.add(vTransaction);
    }
    return vTransactions;
  }
View Full Code Here

    Transaction t1 = new Transaction();
    t1.setAmount(new BigDecimal(-1625));
    t1.setCurrency(Currency.getInstance("SEK"));
    t1.setDescription("Company name 1");
    t1.setTransactionDate(new LocalDate("2014-01-23"));
    transactions.add(t1);

    Transaction t2 = new Transaction();
    t2.setAmount(new BigDecimal(2980));
    t2.setCurrency(Currency.getInstance("SEK"));
    t2.setDescription("Betalning");
    t2.setTransactionDate(new LocalDate("2014-01-27"));
    transactions.add(t2);

    return transactions;
  }
View Full Code Here

TOP

Related Classes of org.joda.time.LocalDate

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.