My requirement is to set current date as default date in calendar only but it is also displaying in text field .
Below is my code.
private static DynamicForm createDateItem(String name) {
final DateItem dateItem = new DateItem("name");
dateItem.setRequired(false);
final DynamicForm form = new DynamicForm();
form.setTitleSuffix("");
form.setItems(dateItem);
form.setZIndex(0);
dateItem.setTitle("");
dateItem.setUseTextField(true);
dateItem.setEnforceDate(true);
final DateDisplayFormat format = DateDisplayFormat.TOEUROPEANSHORTDATE;
dateItem.setDateFormatter(format);
dateItem.setInputFormat("DMY");
dateItem.setDisplayFormat(format);
return form;
}
Screenshot is attached. Please look in to this.
Below is my code.
private static DynamicForm createDateItem(String name) {
final DateItem dateItem = new DateItem("name");
dateItem.setRequired(false);
final DynamicForm form = new DynamicForm();
form.setTitleSuffix("");
form.setItems(dateItem);
form.setZIndex(0);
dateItem.setTitle("");
dateItem.setUseTextField(true);
dateItem.setEnforceDate(true);
final DateDisplayFormat format = DateDisplayFormat.TOEUROPEANSHORTDATE;
dateItem.setDateFormatter(format);
dateItem.setInputFormat("DMY");
dateItem.setDisplayFormat(format);
return form;
}
Screenshot is attached. Please look in to this.
Comment