British date doesn't look like the French one

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

British date doesn't look like the French one

mark goldin
When I use french locale I get date like this:
dd/mm/tyyyy, but for British (en_GB) I still get mm/dd/yyyy?

Why is that?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: British date doesn't look like the French one

jmclean
Administrator
Hi,

> When I use french locale I get date like this:
> dd/mm/tyyyy, but for British (en_GB) I still get mm/dd/yyyy?

What version of the Flex SDK are you using? en_GB is a supported locate and you should get dd/mm/yyyy

For example this code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           minWidth="955" minHeight="600">
        <mx:DateField id="mydate" selectedDate="{new Date(2016, 6, 4, 13)}"/>
</s:Application>

Will correctly display 4th July as "04/07/2016” when compiled with -locale en_GB.

Thanks,
Justin
Reply | Threaded
Open this post in threaded view
|

RE: British date doesn't look like the French one

mark goldin
4.13.

Sent from my Windows 10 phone

From: Justin Mclean
Sent: Monday, November 6, 2017 4:45 PM
To: [hidden email]
Subject: Re: British date doesn't look like the French one

Hi,

> When I use french locale I get date like this:
> dd/mm/tyyyy, but for British (en_GB) I still get mm/dd/yyyy?

What version of the Flex SDK are you using? en_GB is a supported locate and you should get dd/mm/yyyy

For example this code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           minWidth="955" minHeight="600">
        <mx:DateField id="mydate" selectedDate="{new Date(2016, 6, 4, 13)}"/>
</s:Application>

Will correctly display 4th July as "04/07/2016” when compiled with -locale en_GB.

Thanks,
Justin

Reply | Threaded
Open this post in threaded view
|

Re: British date doesn't look like the French one

jmclean
Administrator
Hi,

> 4.13.

I just tried the example I provided in 4.13 and it works as expected. Are you sure you sure your setting the locale to en_GB?

Can you provides some sample code you are trying to get to work.

Thanks,
Justin
Reply | Threaded
Open this post in threaded view
|

RE: British date doesn't look like the French one

mark goldin
Well, I am using mx. Maybe that's the problem?

Sent from my Windows 10 phone

From: Justin Mclean
Sent: Monday, November 6, 2017 4:57 PM
To: [hidden email]
Subject: Re: British date doesn't look like the French one

Hi,

> 4.13.

I just tried the example I provided in 4.13 and it works as expected. Are you sure you sure your setting the locale to en_GB?

Can you provides some sample code you are trying to get to work.

Thanks,
Justin

Reply | Threaded
Open this post in threaded view
|

Re: British date doesn't look like the French one

jmclean
Administrator
Hi,

> Well, I am using mx. Maybe that's the problem?

The example I provided used mx:DateField. If you provide some sample code perhaps we can sort out the issue.

Thanks,
Justin
Reply | Threaded
Open this post in threaded view
|

RE: British date doesn't look like the French one

Idylog - Nicolas Granon
In reply to this post by mark goldin
I do not believe so...

You should definitely check the .properties file and also check with some string (from framework bundles) that you know is different between US and EN.

Nicolas Granon




> -----Message d'origine-----
> De : mark goldin [mailto:[hidden email]]
> Envoyé : mardi 7 novembre 2017 00:03
> À : [hidden email]
> Objet : RE: British date doesn't look like the French one
>
> Well, I am using mx. Maybe that's the problem?
>
> Sent from my Windows 10 phone
>
> From: Justin Mclean
> Sent: Monday, November 6, 2017 4:57 PM
> To: [hidden email]
> Subject: Re: British date doesn't look like the French one
>
> Hi,
>
> > 4.13.
>
> I just tried the example I provided in 4.13 and it works as expected.
> Are you sure you sure your setting the locale to en_GB?
>
> Can you provides some sample code you are trying to get to work.
>
> Thanks,
> Justin


Reply | Threaded
Open this post in threaded view
|

Re: British date doesn't look like the French one

jmclean
Administrator
Hi,

Try this:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           layout="vertical"
                           initialize="init(event)">
        <fx:Script>
                <![CDATA[
                        import mx.events.FlexEvent;
                        import mx.resources.IResourceManager;
                        import mx.resources.ResourceManager;
                       
                        [Bindable]
                        public var dateFormat:String;
                        [Bindable]
                        public var locale:String;
                       
                        protected function init(event:FlexEvent):void
                        {
                                var rm:IResourceManager = ResourceManager.getInstance();
                                locale = rm.localeChain.toString();
                                dateFormat = rm.getString("SharedResources", "dateFormat");
                        }
                       
                ]]>
        </fx:Script>
        <mx:DateField id="mydate" selectedDate="{new Date(2016, 6, 4, 13)}"/>
        <mx:Label text="{locale}" />
                <mx:Label text="{dateFormat}" />
</mx:Application>

It should display “en_GB” and “DD/MM/YYYY” if you can compiled with the en_GB locale.

Thanks,
Justin
Reply | Threaded
Open this post in threaded view
|

Re: British date doesn't look like the French one

mark goldin
Your sample code is working fine when I am compiling it with compiler
option - en_GB. However my application is still not working. I am trying
trouble shooting it. Here is what I have. First of all, the app gets its
resource file as a parameter that being injected when the app is starting.
I have built en_GB resource file in FB using Builders/Local resources. I
then copied en_GB_ResourceModule.swf into the application resources
location. When I run the app rm.getString("SharedResources", "dateFormat")
shows "DD/MM/YYYY". The date from your code: Date(2016, 6, 4, 13) is shown
in the Debugger like this: Tue Nov 7 03:52:35 GMT-0600 2017. Is that
correct?

Thanks

On Mon, Nov 6, 2017 at 5:32 PM Justin Mclean <[hidden email]>
wrote:

> Hi,
>
> Try this:
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                            xmlns:s="library://ns.adobe.com/flex/spark"
>                            xmlns:mx="library://ns.adobe.com/flex/mx"
>                            layout="vertical"
>                            initialize="init(event)">
>         <fx:Script>
>                 <![CDATA[
>                         import mx.events.FlexEvent;
>                         import mx.resources.IResourceManager;
>                         import mx.resources.ResourceManager;
>
>                         [Bindable]
>                         public var dateFormat:String;
>                         [Bindable]
>                         public var locale:String;
>
>                         protected function init(event:FlexEvent):void
>                         {
>                                 var rm:IResourceManager =
> ResourceManager.getInstance();
>                                 locale = rm.localeChain.toString();
>                                 dateFormat =
> rm.getString("SharedResources", "dateFormat");
>                         }
>
>                 ]]>
>         </fx:Script>
>         <mx:DateField id="mydate" selectedDate="{new Date(2016, 6, 4,
> 13)}"/>
>         <mx:Label text="{locale}" />
>                 <mx:Label text="{dateFormat}" />
> </mx:Application>
>
> It should display “en_GB” and “DD/MM/YYYY” if you can compiled with the
> en_GB locale.
>
> Thanks,
> Justin
Reply | Threaded
Open this post in threaded view
|

Re: British date doesn't look like the French one

mark goldin
Actually I found the problem. The legacy application has its own local
formater that needed to be updated. As always, debugging one thing helps to
find a problem in another. Thanks to you guys for all the help.

On Tue, Nov 7, 2017 at 3:54 AM mark goldin <[hidden email]> wrote:

> Your sample code is working fine when I am compiling it with compiler
> option - en_GB. However my application is still not working. I am trying
> trouble shooting it. Here is what I have. First of all, the app gets its
> resource file as a parameter that being injected when the app is starting.
> I have built en_GB resource file in FB using Builders/Local resources. I
> then copied en_GB_ResourceModule.swf into the application resources
> location. When I run the app rm.getString("SharedResources", "dateFormat")
> shows "DD/MM/YYYY". The date from your code: Date(2016, 6, 4, 13) is shown
> in the Debugger like this: Tue Nov 7 03:52:35 GMT-0600 2017. Is that
> correct?
>
> Thanks
>
> On Mon, Nov 6, 2017 at 5:32 PM Justin Mclean <[hidden email]>
> wrote:
>
>> Hi,
>>
>> Try this:
>> <?xml version="1.0" encoding="utf-8"?>
>> <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>>                            xmlns:s="library://ns.adobe.com/flex/spark"
>>                            xmlns:mx="library://ns.adobe.com/flex/mx"
>>                            layout="vertical"
>>                            initialize="init(event)">
>>         <fx:Script>
>>                 <![CDATA[
>>                         import mx.events.FlexEvent;
>>                         import mx.resources.IResourceManager;
>>                         import mx.resources.ResourceManager;
>>
>>                         [Bindable]
>>                         public var dateFormat:String;
>>                         [Bindable]
>>                         public var locale:String;
>>
>>                         protected function init(event:FlexEvent):void
>>                         {
>>                                 var rm:IResourceManager =
>> ResourceManager.getInstance();
>>                                 locale = rm.localeChain.toString();
>>                                 dateFormat =
>> rm.getString("SharedResources", "dateFormat");
>>                         }
>>
>>                 ]]>
>>         </fx:Script>
>>         <mx:DateField id="mydate" selectedDate="{new Date(2016, 6, 4,
>> 13)}"/>
>>         <mx:Label text="{locale}" />
>>                 <mx:Label text="{dateFormat}" />
>> </mx:Application>
>>
>> It should display “en_GB” and “DD/MM/YYYY” if you can compiled with the
>> en_GB locale.
>>
>> Thanks,
>> Justin
>
>