Package org.joda.time

Examples of org.joda.time.LocalDate$Property


    @Override
    protected LocalDate doParse(final Object context, final String entry, final Localization localization) {

        updateTitleStringFormatterIfOverridden();
       
        LocalDate contextDate = (LocalDate) context;

        final String dateString = entry.trim().toUpperCase();
        if (dateString.startsWith("+") && contextDate != null) {
            return JodaLocalDateUtil.relativeDate(contextDate, dateString, true);
        } else if (dateString.startsWith("-"&& contextDate != null) {
View Full Code Here


    @Override
    public String titleString(final Object value, final Localization localization) {
        if (value == null) {
            return null;
        }
        final LocalDate date = (LocalDate) value;
        DateTimeFormatter f = titleStringFormatter;
        if (localization != null) {
            f = titleStringFormatter.withLocale(localization.getLocale());
        }
        return JodaLocalDateUtil.titleString(f, date);
View Full Code Here

        return JodaLocalDateUtil.titleString(f, date);
    }

    @Override
    public String titleStringWithMask(final Object value, final String usingMask) {
        final LocalDate date = (LocalDate) value;
        return JodaLocalDateUtil.titleString(DateTimeFormat.forPattern(usingMask), date);
    }
View Full Code Here

    // 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

TOP

Related Classes of org.joda.time.LocalDate$Property

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.