use of io.jmix.core.entity.annotation.IgnoreUserTimeZone in project jmix by jmix-framework.
the class DataAwareComponentsTools method setupZoneId.
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 = currentAuthentication.getTimeZone();
component.setTimeZone(timeZone);
}
}
}
}
Aggregations