Package in.partake.base

Examples of in.partake.base.DateTime.toDate()


        {
            DateTime beginDate = getDateTimeParameter("beginDate");
            if (beginDate == null)
                return renderInvalid(UserErrorCode.INVALID_PARAMETERS, Collections.singletonMap("beginDate", "開始日時は必ず入力して下さい。"));

            Calendar beginCalendar = TimeUtil.calendar(beginDate.toDate());
            if (beginCalendar.get(Calendar.YEAR) < 2000 || 2100 < beginCalendar.get(Calendar.YEAR))
                return renderInvalid(UserErrorCode.INVALID_PARAMETERS, Collections.singletonMap("beginDate", "開始日時の範囲が不正です。"));

            embryo.setBeginDate(beginDate);
        }
View Full Code Here


        // endDate
        {
            DateTime endDate = getDateTimeParameter("endDate");
            if (endDate != null) {
                Calendar endCalendar = TimeUtil.calendar(endDate.toDate());
                if (endCalendar.get(Calendar.YEAR) < 2000 || 2100 < endCalendar.get(Calendar.YEAR))
                    return renderInvalid(UserErrorCode.INVALID_PARAMETERS, Collections.singletonMap("endDate", "終了日時の範囲が不正です。"));

                if (!embryo.getBeginDate().isBefore(endDate))
                    return renderInvalid(UserErrorCode.INVALID_PARAMETERS, Collections.singletonMap("endDate", "終了日時が開始日時より前になっています。"));
View Full Code Here

        if (params.containsKey("beginDate")) {
            DateTime beginDate = getDateTime("beginDate");
            if (beginDate == null)
                throw new PartakeException(UserErrorCode.INVALID_PARAMETERS, "beginDate", "開始日時は必ず入力してください。");

            Calendar beginCalendar = TimeUtil.calendar(beginDate.toDate());
            if (beginCalendar.get(Calendar.YEAR) < 2000 || 2100 < beginCalendar.get(Calendar.YEAR))
                throw new PartakeException(UserErrorCode.INVALID_PARAMETERS, "beginDate", "開始日時の範囲が不正です。");
            else
                event.setBeginDate(beginDate);
View Full Code Here

            else {
                DateTime endDate = TimeUtil.parseForEvent(endDateStr);
                if (endDate == null)
                    throw new PartakeException(UserErrorCode.INVALID_PARAMETERS, "endDate", "終了日時が不正です。");
                else {
                    Calendar endCalendar = TimeUtil.calendar(endDate.toDate());
                    if (endCalendar.get(Calendar.YEAR) < 2000 || 2100 < endCalendar.get(Calendar.YEAR))
                        throw new PartakeException(UserErrorCode.INVALID_PARAMETERS, "endDate", "終了日時の範囲が不正です。");
                    else if (event.getBeginDate() != null && endDate.isBefore(event.getBeginDate()))
                        throw new PartakeException(UserErrorCode.INVALID_PARAMETERS, "endDate", "終了日時が開始日時より前になっています。");
                    else
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.