Localization of Months and Day names

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Localization of Months and Day names

Esteban A. Maringolo
What is the "official way" (if any) to localize the printing of Date
Month and Day names?

I saw there is a Locale class, but neither the primLongDateFormat and
primShortDateFormat have any senders, so if they're used, it's not
through message sends.

Regards!

Esteban A. Maringolo

Reply | Threaded
Open this post in threaded view
|

Re: Localization of Months and Day names

Sven Van Caekenberghe-2
I don't know, Locale is not a very useful class.

You might want to have a look at ZTimestampFormat, part of https://github.com/svenvc/ztimestamp

(ZTimestampFormat fromString: 'SATURDAY, FEBRUARY 03 2001 (16:05:06)')
        french;
        format: DateAndTime now.
       
"'MECREDI, DÉCEMBRE 18 2019 (07:44:07)'"

(ZTimestampFormat fromString: 'SATURDAY, FEBRUARY 03 2001 (16:05:06)')
        german;
        format: DateAndTime now.
       
"'MITTWOCH, DEZEMBER 18 2019 (07:44:28)'"

The first argument is an example, based on a reference date. There is lot of documentation.

> On 18 Dec 2019, at 02:55, Esteban Maringolo <[hidden email]> wrote:
>
> What is the "official way" (if any) to localize the printing of Date
> Month and Day names?
>
> I saw there is a Locale class, but neither the primLongDateFormat and
> primShortDateFormat have any senders, so if they're used, it's not
> through message sends.
>
> Regards!
>
> Esteban A. Maringolo
>