Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGWT.mobile - How to Set DateItem's default value to the current Date???

    I can't seem to set the DateItem to the current date.


    Here's a code snippet from what I tried initially.
    Code:
      date.setSelectorFormat(DateItemSelectorFormat.DAY_MONTH_YEAR);
            LogicalDate startDate = new LogicalDate();
            startDate = new LogicalDate(startDate.getLogicalYear(), startDate.getLogicalMonth() - 2, startDate.getLogicalDate());
            date.setStartDate(startDate);
            LogicalDate endDate = new LogicalDate(startDate.getLogicalYear(), startDate.getLogicalMonth() + 12, startDate.getLogicalDate());
            date.setEndDate(endDate);
            date.setDefaultValue(Calendar.getInstance());
Working...
X