Skip to content

[intl] IntlDateFormatter::format polyfill does not support \DateTimeInterface #32898

Closed
@Tobion

Description

@Tobion

IntlDateFormatter::format supports DateTimeInterface since php 7.1.5, see https://www.php.net/manual/en/intldateformatter.format.php

7.1.5 | Support for providing general DateTimeInterface objects to the value parameter was added. Formerly, only properDateTime objects were supported.

But symfony/intl polyfill does not, see

if (!\is_int($timestamp) && !$timestamp instanceof \DateTime) {
$argumentError = sprintf('datefmt_format: string \'%s\' is not numeric, which would be required for it to be a valid date', $timestamp);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions