I want to know how can I implement a date chooser in SmartGWT to show other dates for example: chinese,perisan,arabic dates. Any code or link to some site will be appreciated. I tried searching SmartGWT forum but could not find any help.
I went a step further by doing some work and managed to go one step in the front. What I did is I used a Persian calendar and set it in this method like this:
dateChooser.setData(CommonUtil.gregorianToJalali(new Date()));
But don't know how to change those other things. Please help get it working
Here is the full code:
public class DateChooserSample extends VLayout{
public DateChooserSample() {
init();
}
public void init() {
setShowEdges(true);
setWidth(150);
setMembersMargin(5);
setLayoutMargin(10);
DynamicForm form = new DynamicForm();
form.setWidth(300);
final BlurbItem blurbItem = new BlurbItem();
form.setItems(blurbItem);
final DateChooser dateChooser = new DateChooser();
dateChooser.setData(CommonUtil.gregorianToJalali(new Date()));
dateChooser.setWidth(100);
blurbItem.setValue("Current date : " + CommonUtil.gregorianToJalali(new Date()));
dateChooser.addDataChangedHandler(new DataChangedHandler() {
@Override
public void onDataChanged(DataChangedEvent event) {
blurbItem.setValue("Selected date : " + CommonUtil.gregorianToJalali(dateChooser.getData()));
}
});
addMember(dateChooser);
addMember(form);
}
}