mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-16 01:01:02 +00:00
bug4210 Extracted date format creation to a unique place
This commit is contained in:
1 parent
f816d16639
commit
608319dbf2
3 files changed
+7
-4
No files matched your search
+2
-1
@@ -3,6 +3,7 @@ package com.sap.sailing.gwt.common.client.datetime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
||||
@@ -28,7 +29,7 @@ public class DateAndTimeInput extends AbstractInput {
|
||||
add(this.timeInput = new TimeInput(accuracy));
|
||||
dateInput.addStyleName(DateTimeInputResources.INSTANCE.css().dateTimeInput());
|
||||
timeInput.addStyleName(DateTimeInputResources.INSTANCE.css().dateTimeInput());
|
||||
this.dateFormat = DateTimeFormat.getFormat("yyyy-MM-dd");
|
||||
this.dateFormat = DateInput.DATE_FORMAT;
|
||||
this.timeFormat = accuracy.getTimeFormat();
|
||||
this.datetimeFormat = accuracy.getDatetimeFormat();
|
||||
}
|
||||
|
||||
+3
-1
@@ -6,8 +6,10 @@ import com.google.gwt.user.datepicker.client.DateBox;
|
||||
|
||||
public class DateInput extends AbstractInput {
|
||||
|
||||
static final DateTimeFormat DATE_FORMAT = DateTimeFormat.getFormat("yyyy-MM-dd");
|
||||
|
||||
public DateInput() {
|
||||
super(DateTimeInputType.TIME.isSupported() ? NativeDateTimeInput.date() : new CustomDateBox());
|
||||
super(DateTimeInputType.TIME.isSupported() ? NativeDateTimeInput.date(DATE_FORMAT) : new CustomDateBox());
|
||||
}
|
||||
|
||||
private static class CustomDateBox extends DateBox {
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@ class NativeDateTimeInput extends Widget implements DateTimeInput {
|
||||
|
||||
private static final String ATTR_TYPE = "type", ATTR_STEP = "step";
|
||||
|
||||
static DateTimeInput date() {
|
||||
return new NativeDateTimeInput(DateTimeInputType.DATE, "", DateTimeFormat.getFormat("yyyy-MM-dd"));
|
||||
static DateTimeInput date(DateTimeFormat dateFormat) {
|
||||
return new NativeDateTimeInput(DateTimeInputType.DATE, "", dateFormat);
|
||||
}
|
||||
|
||||
static DateTimeInput time(Accuracy accuracy) {
|
||||
|
||||
Reference in new issue
Block a user