uiService.sendDataToServer(instruction);
}
@Override
public void update(final PTInstruction update, final UIService uiService) {
final DatePicker picker = cast();
if (update.containsKey(PROPERTY.VALUE)) {
picker.setValue(asDate(update.getString(PROPERTY.VALUE)));
} else if (update.containsKey(PROPERTY.MONTH)) {
picker.setCurrentMonth(asDate(update.getString(PROPERTY.MONTH)));
} else if (update.containsKey(PROPERTY.DATE_ENABLED)) {
final Boolean enabled = update.getBoolean(PROPERTY.ENABLED);
final JSONArray jsonArray = update.get(PROPERTY.DATE_ENABLED).isArray();
for (int i = 0; i < jsonArray.size(); i++) {
picker.setTransientEnabledOnDates(enabled, asDate(jsonArray.get(i).isString().stringValue()));
}
} else if (update.containsKey(PROPERTY.ADD_DATE_STYLE)) {
final String style = update.getString(PROPERTY.STYLE_NAME);
final JSONArray jsonArray = update.get(PROPERTY.ADD_DATE_STYLE).isArray();
for (int i = 0; i < jsonArray.size(); i++) {
picker.addStyleToDates(style, asDate(jsonArray.get(i).isString().stringValue()));
}
} else if (update.containsKey(PROPERTY.REMOVE_DATE_STYLE)) {
final String style = update.getString(PROPERTY.STYLE_NAME);
final JSONArray jsonArray = update.get(PROPERTY.REMOVE_DATE_STYLE).isArray();
for (int i = 0; i < jsonArray.size(); i++) {
picker.removeStyleFromDates(style, asDate(jsonArray.get(i).isString().stringValue()));
}
} else {
super.update(update, uiService);
}
}