protected DateField createComponentForDate(DateField.Resolution resolution) { DateField dateField = uiComponents.create(DateField.class); dateField.setResolution(resolution); if (timeZone != null) { dateField.setTimeZone(timeZone); } return dateField; }
public void setupZoneId(DateField component, EntityValueSource valueSource) { if (component.getZoneId() == null) { MetaProperty metaProperty = valueSource.getMetaPropertyPath().getMetaProperty(); Class javaType = metaProperty.getRange().asDatatype().getJavaClass(); if (dateTimeTransformations.isDateTypeSupportsTimeZones(javaType)) { Boolean ignoreUserTimeZone = metadataTools.getMetaAnnotationValue(metaProperty, IgnoreUserTimeZone.class); if (!Boolean.TRUE.equals(ignoreUserTimeZone)) { TimeZone timeZone = userSessionSource.getUserSession().getTimeZone(); component.setTimeZone(timeZone); } } } }
dateField.setDateFormat(formatStr); if (userSession.getTimeZone() != null && supportTimezones) { dateField.setTimeZone(userSession.getTimeZone());
UserSession userSession = userSessionSource.getUserSession(); if (userSession.getTimeZone() != null) { dateField.setTimeZone(userSession.getTimeZone()); dateField.setTimeZone(TimeZone.getDefault()); dateField.setEditable(true);