php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75043 IntlDateFormatter incorrectly formats days of week for es_MX
Submitted: 2017-08-07 09:13 UTC Modified: 2017-08-07 09:37 UTC
From: gytis dot skema at gmail dot com Assigned:
Status: Not a bug Package: intl (PECL)
PHP Version: 7.0.22 OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gytis dot skema at gmail dot com
New email:
PHP Version: OS:

 

 [2017-08-07 09:13 UTC] gytis dot skema at gmail dot com
Description:
------------
"vie" and 'lun' do not end with a dot, but should, as described in
http://demo.icu-project.org/icu-bin/locexp?d_=en&_=es_MX

Also, es_ES returns uppercased first letter, while es_MX does not. This should be investigated

Test script:
---------------
$formatter = new \IntlDateFormatter(
    'es_MX',
    \IntlDateFormatter::NONE,
    \IntlDateFormatter::NONE,
    ini_get('date.timezone')
);

$formatter->setPattern('ccc');

var_dump([
    $formatter->format(new DateTime('2018-09-05')),
    $formatter->format(new DateTime('2018-09-06')),
    $formatter->format(new DateTime('2018-09-07')),
    $formatter->format(new DateTime('2018-09-08')),
    $formatter->format(new DateTime('2018-09-09')),
    $formatter->format(new DateTime('2018-09-10')),
    $formatter->format(new DateTime('2018-09-11')),
]);


Expected result:
----------------
  0 => string 'Mié.' (length=5)
  1 => string 'Jue.' (length=4)
  2 => string 'Vie.' (length=3)
  3 => string 'Sáb.' (length=5)
  4 => string 'Dom.' (length=4)
  5 => string 'Lun.' (length=3)
  6 => string 'Mar.' (length=4)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-07 09:37 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: Calendar related +Package: intl
 [2017-08-07 09:37 UTC] requinix@php.net
Speaking of investigation,

https://3v4l.org/hjeJp

Looks like you're running a version of libicu < 57.1. Not sure exactly when they fixed it - a few searches through their bugtracker didn't turn up anything.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Feb 29 08:01:27 2020 UTC