*/
public FormItem addFormItem(Locale locale, User user, String usageIdentifyer, boolean isAdministrativeUser, FormItemContainer formItemContainer) {
org.olat.core.gui.components.form.flexible.elements.DateChooser dateElem = null;
dateElem = FormUIFactory.getInstance().addDateChooser(getName(), i18nFormElementLabelKey(), getInternalValue(user), formItemContainer);
dateElem.setItemValidatorProvider(this);
UserManager um = UserManager.getInstance();
if ( um.isUserViewReadOnly(usageIdentifyer, this) && ! isAdministrativeUser) {
dateElem.setEnabled(false);
}
if (um.isMandatoryUserProperty(usageIdentifyer, this)) {
dateElem.setMandatory(true);
}
dateElem.setExampleKey("form.example.free", new String[] {Formatter.getInstance(locale).formatDate(new Date())});
return dateElem;