Search in sources :

Example 1 with ContactBirthdayException

use of com.liferay.portal.ContactBirthdayException in project liferay-ide by liferay.

the class UserLocalServiceImpl method getBirthday.

protected Date getBirthday(int birthdayMonth, int birthdayDay, int birthdayYear) throws PortalException {
    Date birthday = PortalUtil.getDate(birthdayMonth, birthdayDay, birthdayYear, ContactBirthdayException.class);
    Date now = new Date();
    if (birthday.after(now)) {
        throw new ContactBirthdayException();
    }
    return birthday;
}
Also used : ContactBirthdayException(com.liferay.portal.ContactBirthdayException) Date(java.util.Date)

Aggregations

ContactBirthdayException (com.liferay.portal.ContactBirthdayException)1 Date (java.util.Date)1