Examples of LocalDateTime


Examples of org.joda.time.LocalDateTime

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage1));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 750));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 200));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100 * 1000 + 50));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(100, 5), calculator.calculate(usage));
    }
View Full Code Here

Examples of org.joda.time.LocalDateTime

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage1));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 751));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 201));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100 * 1000 + 50));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(100, 45), calculator.calculate(usage));
    }
View Full Code Here

Examples of org.joda.time.LocalDateTime

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage2));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 2000));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 500));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 300 * 1000));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(200, 0), calculator.calculate(usage));
    }
View Full Code Here

Examples of org.joda.time.LocalDateTime

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage2));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 2001));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 501));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 300 * 1000 + 100));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(200, 35), calculator.calculate(usage));
    }
View Full Code Here

Examples of org.joda.time.LocalDateTime

    public void testVipUserNewJoinWithInLimit() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 15);
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 200));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 200));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100 * 1000));
        data.put(UserField.kSlips, slips);

        data.put(UserField.kIsNewUser, true);

        UserMonthUsage usage = new UserMonthUsage(1, data);
View Full Code Here

Examples of org.joda.time.LocalDateTime

    public void testVipUserNewJoinMore() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 15);
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 201));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 201));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100 * 1000 + 100));
        data.put(UserField.kSlips, slips);

        data.put(UserField.kIsNewUser, true);

        UserMonthUsage usage = new UserMonthUsage(1, data);
View Full Code Here

Examples of org.joda.time.LocalDateTime

        final DateTimeZone timeZone = DateTimeZone.forTimeZone(TimeZone.getDefault());
        return new LocalDate(getTime(), timeZone);
    }

    public static LocalDateTime getTimeAsLocalDateTime() {
        return new LocalDateTime(getTime(), Defaults.getTimeZone());
    }
View Full Code Here

Examples of org.joda.time.LocalDateTime

    }

    private JodaValuedEntity createEntity() {
        final JodaValuedEntity jve = jodaValuesEntityRepository.newEntity();
        jve.setLocalDateProperty(new LocalDate(2008,3,21));
        jve.setLocalDateTimeProperty(new LocalDateTime(2009, 4, 29, 13, 45, 22));
        jve.setDateTimeProperty(new DateTime(2010, 3, 31, 9, 50, 43, DateTimeZone.UTC));
        return jve;
    }
View Full Code Here

Examples of org.joda.time.LocalDateTime

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

        updateTitleStringFormatterIfOverridden();
       
        LocalDateTime contextDateTime = (LocalDateTime) context;

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

Examples of org.joda.time.LocalDateTime

    @Override
    public String titleString(final Object value, final Localization localization) {
        if (value == null) {
            return null;
        }
        final LocalDateTime dateTime = (LocalDateTime) value;
        DateTimeFormatter f = titleStringFormatter;
        if (localization != null) {
            f = titleStringFormatter.withLocale(localization.getLocale());
        }
        return JodaLocalDateTimeUtil.titleString(f, dateTime);
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.