Date formatting with en_US locale

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Date formatting with en_US locale

Eric van Gyzen-5
Baptiste and -current,

I noticed two annoyances with date formatting on head, and I wonder how
we can fix them.

I have these settings:

    LC_ALL=en_US.ISO8859-1
    LANG=en_US.ISO8859-1

First, Thunderbird displays the date as, for example:

    03/ 6/16 ...

The leading space on the day (6) looks weird.  I might even say it's
simply wrong.  Zero-padding would better.  (/No/ padding would be best,
but I don't think strftime supports that.)

Second, date(1) no longer shows the day-of-week:

    $ date
    March 26, 2016 at 09:21:55 AM CDT

For many years, I have been typing "date" to see the day-of-week (and
other things).  I like the new human-friendly format, but I miss the
day-of-week.

Of course, I can fix these locally, but I wonder how we can fix them for
everyone.  I see that the formats come from CLDR.  I also see that ume@
restored the day-of-week for ja_JP in r292512.  Is this the best
approach, or should we try to get them changed upstream (CLDR)?

Thanks for your input,

Eric

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting with en_US locale

Baptiste Daroussin-2
On Thu, May 26, 2016 at 09:44:25AM -0500, Eric van Gyzen wrote:

> Baptiste and -current,
>
> I noticed two annoyances with date formatting on head, and I wonder how
> we can fix them.
>
> I have these settings:
>
>     LC_ALL=en_US.ISO8859-1
>     LANG=en_US.ISO8859-1
>
> First, Thunderbird displays the date as, for example:
>
>     03/ 6/16 ...
>
> The leading space on the day (6) looks weird.  I might even say it's
> simply wrong.  Zero-padding would better.  (/No/ padding would be best,
> but I don't think strftime supports that.)
>
> Second, date(1) no longer shows the day-of-week:
>
>     $ date
>     March 26, 2016 at 09:21:55 AM CDT
>
> For many years, I have been typing "date" to see the day-of-week (and
> other things).  I like the new human-friendly format, but I miss the
> day-of-week.
>
> Of course, I can fix these locally, but I wonder how we can fix them for
> everyone.  I see that the formats come from CLDR.  I also see that ume@
> restored the day-of-week for ja_JP in r292512.  Is this the best
> approach, or should we try to get them changed upstream (CLDR)?
>
> Thanks for your input,
I can hack cldr2def.pl to readd the week of day as it was before for 11.0 still
the best approach is to push the change upstream.

I will have a look at the cldr2def.pl hack this week end.

Best regards,
Bapt

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting with en_US locale

Otacílio de Araújo Ramos Neto-3
Em 26/05/2016 11:49, Baptiste Daroussin escreveu:

> On Thu, May 26, 2016 at 09:44:25AM -0500, Eric van Gyzen wrote:
>> Baptiste and -current,
>>
>> I noticed two annoyances with date formatting on head, and I wonder how
>> we can fix them.
>>
>> I have these settings:
>>
>>      LC_ALL=en_US.ISO8859-1
>>      LANG=en_US.ISO8859-1
>>
>> First, Thunderbird displays the date as, for example:
>>
>>      03/ 6/16 ...
>>
>> The leading space on the day (6) looks weird.  I might even say it's
>> simply wrong.  Zero-padding would better.  (/No/ padding would be best,
>> but I don't think strftime supports that.)
>>
>> Second, date(1) no longer shows the day-of-week:
>>
>>      $ date
>>      March 26, 2016 at 09:21:55 AM CDT
>>
>> For many years, I have been typing "date" to see the day-of-week (and
>> other things).  I like the new human-friendly format, but I miss the
>> day-of-week.
>>
>> Of course, I can fix these locally, but I wonder how we can fix them for
>> everyone.  I see that the formats come from CLDR.  I also see that ume@
>> restored the day-of-week for ja_JP in r292512.  Is this the best
>> approach, or should we try to get them changed upstream (CLDR)?
>>
>> Thanks for your input,
> I can hack cldr2def.pl to readd the week of day as it was before for 11.0 still
> the best approach is to push the change upstream.
>
> I will have a look at the cldr2def.pl hack this week end.
>
> Best regards,
> Bapt

LANG=pt_BR.UTF-8

MM_CHARSET=UTF-8

also no longer shows the day-of-week

[ota@nostromo /usr/home/ota]$ date
26 de maio de 2016 11:54:44 BRT

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting with en_US locale

Baptiste Daroussin-2
On Thu, May 26, 2016 at 11:55:08AM -0300, Otacílio wrote:

> Em 26/05/2016 11:49, Baptiste Daroussin escreveu:
> > On Thu, May 26, 2016 at 09:44:25AM -0500, Eric van Gyzen wrote:
> >> Baptiste and -current,
> >>
> >> I noticed two annoyances with date formatting on head, and I wonder how
> >> we can fix them.
> >>
> >> I have these settings:
> >>
> >>      LC_ALL=en_US.ISO8859-1
> >>      LANG=en_US.ISO8859-1
> >>
> >> First, Thunderbird displays the date as, for example:
> >>
> >>      03/ 6/16 ...
> >>
> >> The leading space on the day (6) looks weird.  I might even say it's
> >> simply wrong.  Zero-padding would better.  (/No/ padding would be best,
> >> but I don't think strftime supports that.)
> >>
> >> Second, date(1) no longer shows the day-of-week:
> >>
> >>      $ date
> >>      March 26, 2016 at 09:21:55 AM CDT
> >>
> >> For many years, I have been typing "date" to see the day-of-week (and
> >> other things).  I like the new human-friendly format, but I miss the
> >> day-of-week.
> >>
> >> Of course, I can fix these locally, but I wonder how we can fix them for
> >> everyone.  I see that the formats come from CLDR.  I also see that ume@
> >> restored the day-of-week for ja_JP in r292512.  Is this the best
> >> approach, or should we try to get them changed upstream (CLDR)?
> >>
> >> Thanks for your input,
> > I can hack cldr2def.pl to readd the week of day as it was before for 11.0 still
> > the best approach is to push the change upstream.
> >
> > I will have a look at the cldr2def.pl hack this week end.
> >
> > Best regards,
> > Bapt
>
> LANG=pt_BR.UTF-8
>
> MM_CHARSET=UTF-8
>
By adding the hack I mean to do it for all locales not cherry picking

Best regards,
Bapt

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting with en_US locale

Eric van Gyzen-5
On 05/26/16 10:15 AM, Baptiste Daroussin wrote:

> On Thu, May 26, 2016 at 11:55:08AM -0300, Otacílio wrote:
>> Em 26/05/2016 11:49, Baptiste Daroussin escreveu:
>>> On Thu, May 26, 2016 at 09:44:25AM -0500, Eric van Gyzen wrote:
>>>> Baptiste and -current,
>>>>
>>>> I noticed two annoyances with date formatting on head, and I wonder how
>>>> we can fix them.
>>>>
>>>> I have these settings:
>>>>
>>>>      LC_ALL=en_US.ISO8859-1
>>>>      LANG=en_US.ISO8859-1
>>>>
>>>> First, Thunderbird displays the date as, for example:
>>>>
>>>>      03/ 6/16 ...
>>>>
>>>> The leading space on the day (6) looks weird.  I might even say it's
>>>> simply wrong.  Zero-padding would better.  (/No/ padding would be best,
>>>> but I don't think strftime supports that.)
>>>>
>>>> Second, date(1) no longer shows the day-of-week:
>>>>
>>>>      $ date
>>>>      March 26, 2016 at 09:21:55 AM CDT
>>>>
>>>> For many years, I have been typing "date" to see the day-of-week (and
>>>> other things).  I like the new human-friendly format, but I miss the
>>>> day-of-week.
>>>>
>>>> Of course, I can fix these locally, but I wonder how we can fix them for
>>>> everyone.  I see that the formats come from CLDR.  I also see that ume@
>>>> restored the day-of-week for ja_JP in r292512.  Is this the best
>>>> approach, or should we try to get them changed upstream (CLDR)?
>>>>
>>>> Thanks for your input,
>>> I can hack cldr2def.pl to readd the week of day as it was before for 11.0 still
>>> the best approach is to push the change upstream.
>>>
>>> I will have a look at the cldr2def.pl hack this week end.
>>>
>>> Best regards,
>>> Bapt
>> LANG=pt_BR.UTF-8
>>
>> MM_CHARSET=UTF-8
>>
> By adding the hack I mean to do it for all locales not cherry picking

Thank you for fixing this!

Above, I mentioned two issues.  The other one is, the date format for
en_US pads the month with a zero, but the day with a space.  So, June 7 is:

        06/ 7/16

That looks weird.  It should pad both with zeros.  I'd be happy to fix
it, but I don't see how:  There isn't an "xformat" callback in the
cldr2def.pl script, and it's not clear how to add one.  If you can
explain, I'll do it.  If you can fix it, I'll be grateful.  ;)

Eric
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting with en_US locale

Baptiste Daroussin-2
On Fri, Jun 17, 2016 at 01:42:22PM -0500, Eric van Gyzen wrote:

> On 05/26/16 10:15 AM, Baptiste Daroussin wrote:
> > On Thu, May 26, 2016 at 11:55:08AM -0300, Otacílio wrote:
> >> Em 26/05/2016 11:49, Baptiste Daroussin escreveu:
> >>> On Thu, May 26, 2016 at 09:44:25AM -0500, Eric van Gyzen wrote:
> >>>> Baptiste and -current,
> >>>>
> >>>> I noticed two annoyances with date formatting on head, and I wonder how
> >>>> we can fix them.
> >>>>
> >>>> I have these settings:
> >>>>
> >>>>      LC_ALL=en_US.ISO8859-1
> >>>>      LANG=en_US.ISO8859-1
> >>>>
> >>>> First, Thunderbird displays the date as, for example:
> >>>>
> >>>>      03/ 6/16 ...
> >>>>
> >>>> The leading space on the day (6) looks weird.  I might even say it's
> >>>> simply wrong.  Zero-padding would better.  (/No/ padding would be best,
> >>>> but I don't think strftime supports that.)
> >>>>
> >>>> Second, date(1) no longer shows the day-of-week:
> >>>>
> >>>>      $ date
> >>>>      March 26, 2016 at 09:21:55 AM CDT
> >>>>
> >>>> For many years, I have been typing "date" to see the day-of-week (and
> >>>> other things).  I like the new human-friendly format, but I miss the
> >>>> day-of-week.
> >>>>
> >>>> Of course, I can fix these locally, but I wonder how we can fix them for
> >>>> everyone.  I see that the formats come from CLDR.  I also see that ume@
> >>>> restored the day-of-week for ja_JP in r292512.  Is this the best
> >>>> approach, or should we try to get them changed upstream (CLDR)?
> >>>>
> >>>> Thanks for your input,
> >>> I can hack cldr2def.pl to readd the week of day as it was before for 11.0 still
> >>> the best approach is to push the change upstream.
> >>>
> >>> I will have a look at the cldr2def.pl hack this week end.
> >>>
> >>> Best regards,
> >>> Bapt
> >> LANG=pt_BR.UTF-8
> >>
> >> MM_CHARSET=UTF-8
> >>
> > By adding the hack I mean to do it for all locales not cherry picking
>
> Thank you for fixing this!
>
> Above, I mentioned two issues.  The other one is, the date format for
> en_US pads the month with a zero, but the day with a space.  So, June 7 is:
>
>         06/ 7/16
>
> That looks weird.  It should pad both with zeros.  I'd be happy to fix
> it, but I don't see how:  There isn't an "xformat" callback in the
> cldr2def.pl script, and it's not clear how to add one.  If you can
> explain, I'll do it.  If you can fix it, I'll be grateful.  ;)
>
> Eric
This one I do not see how to fix, I'll dig into it but I promiss nothing

Best regards,
Bapt

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting with en_US locale

Hajimu UMEMOTO
In reply to this post by Eric van Gyzen-5
Hi,

vangyzen> Above, I mentioned two issues.  The other one is, the date format for
vangyzen> en_US pads the month with a zero, but the day with a space.  So, June 7 is:

vangyzen>         06/ 7/16

vangyzen> That looks weird.  It should pad both with zeros.  I'd be happy to fix
vangyzen> it, but I don't see how:  There isn't an "xformat" callback in the
vangyzen> cldr2def.pl script, and it's not clear how to add one.  If you can
vangyzen> explain, I'll do it.  If you can fix it, I'll be grateful.  ;)

Does the attached patch fix your issue?
Though there are many locales it should be fixed, I've included only
en_US one, in this time.

Sincerely,



--
Hajimu UMEMOTO
[hidden email]  [hidden email]
http://www.mahoroba.org/~ume/

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"

x_fmt-zerofill.diff (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting with en_US locale

Eric van Gyzen-5
On 06/18/16 04:10 AM, Hajimu UMEMOTO wrote:
> Does the attached patch fix your issue?
> Though there are many locales it should be fixed, I've included only
> en_US one, in this time.

Yes, it fixes my issue with en_US.  Thank you, Umemoto-san.

Eric
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting with en_US locale

Hajimu UMEMOTO
Hi,

>>>>> On Sat, 18 Jun 2016 18:25:51 -0500
>>>>> Eric van Gyzen <[hidden email]> said:

vangyzen> On 06/18/16 04:10 AM, Hajimu UMEMOTO wrote:
> Does the attached patch fix your issue?
> Though there are many locales it should be fixed, I've included only
> en_US one, in this time.

vangyzen> Yes, it fixes my issue with en_US.  Thank you, Umemoto-san.

You are welcome.
I've just committed into HEAD.

Sincerely,

--
Hajimu UMEMOTO
[hidden email]  [hidden email]
http://www.mahoroba.org/~ume/
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"