On 4/17/17, 9:48 PM, "Justin Mclean" <jus...@classsoftware.com> wrote:

>Hi,
>
>> That would imply a bug elsewhere DateField.
>
>DateField consist of 3 functions addedToParent and a selectedDate
>setter/getter. How would you fix this bug?
>
>>  The pattern all components
>> should be using is to define an interface for a class of beads, maybe
>> something like IDateFormatBead.
>
>It does exactly this it uses IFormatBead. See the (unmodified) code in
>addedToParent in particular this line:
>var klass:* = ValuesManager.valuesImpl.getValue(this,"iFormatBead");
>
>> Then the code, usually in addedToParent()
>> should use getBeadByType() to see if there is an IDateFormatBead and
>>only
>> if there isn't should it go see if there is a default in CSS.
>
>So addedToParent should call getBeadByType rather than getValue? The
>method was original written by you I believe.

The recommended pattern is in UIBase and hopefully elsewhere:

  if (getBeadByType(IBeadController) == null)
  {
    c = ValuesManager.valuesImpl.getValue(this, "iBeadController") as
Class;
    if (c)
    {
      var controller:IBeadController = new c as IBeadController;
      if (controller)
        addBead(controller);
    }
  }

There are variants where you do something like:

  var controller:IBeadController = getBeadByType(IBeadController);
  If (controller == null)
  {
    c = ValuesManager.valuesImpl.getValue(this, "iBeadController") as
Class;
    if (c)
    {
       controller = new c as IBeadController;
       if (controller)
         addBead(controller);
    }
  }




>
>> I noticed that there was a commit that changed the default date format
>> away from US format.
>
>For dates like 04-12-2017 most of the world would read that as 4th of
>December not the 12th of April. See
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fen.wikipe
>dia.org%2Fwiki%2FDate_format_by_country&data=02%7C01%7C%7Cb00df717e4ad4d4e
>d42608d48616350a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636280877325
>813359&sdata=4oxuGnBG08JW%2BHE03kWBVfgsGFg2hu3eIEFj63j4MjI%3D&reserved=0
>
>> How did we manage the default format in regular Flex?
>
>It was locale dependant (specified in the shared resources resource
>file), currently FlexJS doesn’t support resource files.

Do we need resources in order to make a locale-dependant DateFormat bead?
IMO, with PAYG, you could bake in a specific format that doesn't have to
query the current locale or choose one that does.  It looks like the Intl
class is pretty well supported on JS these days?  Would that and
flash.globalization "do the right thing" without a whole resource
subsystem?

-Alex

Reply via email to