Skip to content

Clarification on Magento Date Column’s Timezone Configuration

I’ve been exploring the configuration options for the Date column in Magento UI component grids. Specifically, I’m trying to understand the purpose of the <timezone> element in the XML configuration.

According to the XSD definition vendor/magento/module-ui/view/base/ui_component/etc/definition/column.xsd, <timezone> is defined as a boolean:

<xs:element name="timezone" type="xs:boolean">
    <xs:annotation>
        <xs:documentation>
            For the Date column: if set to "true", enables date conversion based on the store's timezone configuration.
            If set to "false", date is displayed without timezone conversion.
        </xs:documentation>
    </xs:annotation>
</xs:element>

However, in the actual implementation in Magento’s vendor/magento/module-ui/view/base/web/js/grid/columns/date.js, it seems to be used as a flag to decide whether to perform timezone conversion:

if (!_.isUndefined(this.timezone) && moment.tz.zone(this.timezone) !== null) {
    date = date.tz(this.timezone);
}

This makes me wonder if the <timezone> element is more of a flag than a direct representation of the timezone string.

Could someone provide clarification on how exactly <timezone> is intended to be used? Is it expected to be a boolean flag or a string representation of the timezone?

I appreciate any insights or clarifications from the Magento community.

Thank you!