Skip to content

Commit

Permalink
add max lentgh for date fields (#2208)
Browse files Browse the repository at this point in the history
* add max lentgh for date fields

Signed-off-by: CT\pgoran <goran.palibrk@comtrade.com>
  • Loading branch information
ct-goranpalibrk authored and Coduz committed Nov 28, 2018
1 parent 8f21f00 commit 616e86d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Expand Up @@ -23,7 +23,6 @@
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.button.SplitButton;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TimeField;
Expand Down Expand Up @@ -239,8 +238,9 @@ private void showCustomDateRangeDialog() {
final FormPanel form = new FormPanel();
form.setHeaderVisible(false);

final DateField startDateField = new DateField();
final KapuaDateField startDateField = new KapuaDateField();
startDateField.setFieldLabel(MSGS.dataDateRangeStartDate());
startDateField.setMaxLength(10);
startDateField.setAllowBlank(false);
startDateField.setValue(start);
startDateField.setEditable(false);
Expand All @@ -257,8 +257,9 @@ private void showCustomDateRangeDialog() {
startTimeField.setEditable(false);
form.add(startTimeField, formData);

final DateField endDateField = new DateField();
final KapuaDateField endDateField = new KapuaDateField();
endDateField.setFieldLabel(MSGS.dataDateRangeStopDate());
endDateField.setMaxLength(10);
endDateField.setAllowBlank(false);
endDateField.setValue(end);
endDateField.setEditable(false);
Expand Down
Expand Up @@ -16,7 +16,6 @@
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.TimeField;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.google.gwt.core.client.GWT;
Expand All @@ -27,6 +26,7 @@
import org.eclipse.kapua.app.console.module.api.client.messages.ValidationMessages;
import org.eclipse.kapua.app.console.module.api.client.ui.dialog.entity.EntityAddEditDialog;
import org.eclipse.kapua.app.console.module.api.client.ui.panel.FormPanel;
import org.eclipse.kapua.app.console.module.api.client.ui.widget.KapuaDateField;
import org.eclipse.kapua.app.console.module.api.client.ui.widget.KapuaNumberField;
import org.eclipse.kapua.app.console.module.api.client.ui.widget.KapuaTextField;
import org.eclipse.kapua.app.console.module.api.client.util.ConsoleInfo;
Expand All @@ -53,9 +53,9 @@ public class JobScheduleAddDialog extends EntityAddEditDialog {

private final String jobId;
protected final KapuaTextField<String> triggerName;
protected final DateField startsOn;
protected final KapuaDateField startsOn;
protected final TimeField startsOnTime;
protected final DateField endsOn;
protected final KapuaDateField endsOn;
protected final TimeField endsOnTime;
protected final KapuaNumberField retryInterval;
protected final KapuaTextField<String> cronExpression;
Expand All @@ -67,11 +67,13 @@ public JobScheduleAddDialog(GwtSession currentSession, String jobId) {
this.jobId = jobId;

triggerName = new KapuaTextField<String>();
startsOn = new DateField();
startsOn = new KapuaDateField();
startsOn.setMaxLength(10);
startsOn.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
startsOnTime = new TimeField();
startsOnTime.setEditable(false);
endsOn = new DateField();
endsOn = new KapuaDateField();
endsOn.setMaxLength(10);
endsOn.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
endsOnTime = new TimeField();
endsOnTime.setEditable(false);
Expand Down

0 comments on commit 616e86d

Please sign in to comment.