weixin_39713578 2020-11-30 12:32
浏览 0

Why sonata admin datepicker is not getting dates with september in spanish

Environment

Sonata packages


$ composer show --latest 'sonata-project/*'

sonata-project/admin-bundle              3.35.2 3.39.0 The missing Symfony Admin Generator
sonata-project/block-bundle              3.12.1 3.12.1 Symfony SonataBlockBundle
sonata-project/cache                     2.0.1  2.0.1  Cache library
sonata-project/core-bundle               3.11.1 3.11.2 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.3.1  2.3.1  Symfony SonataDatagridBundle
sonata-project/doctrine-orm-admin-bundle 3.6.1  3.6.1  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/exporter                  1.9.0  1.9.1  Lightweight Exporter library
sonata-project/intl-bundle               2.4.1  2.5.0  Symfony SonataIntlBundle
sonata-project/translation-bundle        2.3.0  2.3.1  SonataTranslationBundle

Symfony packages


$ composer show --latest 'symfony/*'

symfony/monolog-bundle     v3.3.0  v3.3.0 Symfony MonologBundle
symfony/phpunit-bridge     v3.4.11 v4.1.4 Symfony PHPUnit Bridge
symfony/polyfill-apcu      v1.8.0  v1.9.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-ctype     v1.8.0  v1.9.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-icu  v1.8.0  v1.9.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring  v1.8.0  v1.9.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php56     v1.8.0  v1.9.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70     v1.8.0  v1.9.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util      v1.8.0  v1.9.0 Symfony utilities for portability of PHP codes
symfony/security-acl       v3.0.1  v3.0.1 Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v2.6.7  v3.2.3 Symfony SwiftmailerBundle
symfony/symfony            v3.4.11 v4.1.4 The Symfony PHP framework

PHP version


$ php -v

PHP 7.1.20-1+0~20180910100532.3+stretch~1.gbp17c613 (cli) (built: Sep 10 2018 10:05:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.20-1+0~20180910100532.3+stretch~1.gbp17c613, Copyright (c) 1999-2018, by Zend Technologies

Subject

When I send any day of any year with september as a month it's not getting the date.

Steps to reproduce

First I make a composer update. I'm using sonata admin and setted up the config file with:


    sonata_intl:
      timezone:
        default: America/Argentina/Ushuaia

and


    twig:
        debug: '%kernel.debug%'
        strict_variables: '%kernel.debug%'
        form_themes:
            - 'bootstrap_3_layout.html.twig'
            - 'SonataCoreBundle:Form:datepicker.html.twig'

Expected results


    s5bab8a989fa81[fechaDesde]:26 sep. 2018
    s5bab8a989fa81[fechaHasta]:27 oct. 2018
    s5bab8a989fa81[fechaFinProhibicion]:1 dic. 2018

Actual results


    FechaDesde :
    FechaHasta :DateTime Object ( [date] => 2018-10-26 23:00:00.000000 [timezone_type] => 3 [timezone] => America/Sao_Paulo ) 
    FechaFinProhibicion :DateTime Object ( [date] => 2018-12-01 00:00:00.000000 [timezone_type] => 3 [timezone] => America/Sao_Paulo )

该提问来源于开源项目:sonata-project/SonataAdminBundle

  • 写回答

1条回答 默认 最新

  • weixin_39713578 2020-11-30 12:32
    关注

    ### Update With 'format' => \IntlDateFormatter::LONG solve my problem but 'format' => \IntlDateFormatter::MEDIUM is not working

    评论

报告相同问题?