class urn_perun_user_facility_attribute_def_def_o365AccountExtension extends UserFacilityAttributesModuleAbstract implements UserFacilityAttributesModuleImplApi {

	@Override
	public void checkAttributeSyntax(PerunSessionImpl perunSession, User user, Facility facility, Attribute attribute) throws WrongAttributeValueException {
		String o365AccExtTime = attribute.valueAsString();

		if(o365AccExtTime == null) return; //null is allowed value
		Date testDate;
		try {
			testDate = BeansUtils.getDateFormatterWithoutTime().parse(o365AccExtTime);
		} catch (ParseException ex) {
			throw new WrongAttributeValueException(attribute, "Date parsing failed", ex);
		}

		if (!BeansUtils.getDateFormatterWithoutTime().format(testDate).equals(o365AccExtTime)) {
			throw new WrongAttributeValueException(attribute, "Wrong format, yyyy-mm-dd expected.");
		}
	}

}