On 4/17/17, 8:31 PM, "Justin Mclean" <jus...@classsoftware.com> wrote:
>HI, > >> What is the scenario where everybody will need this code? > >If they want to use a date formatter and not have dates displayed as >“YYYY-MM-DD”. > >Before these changes dates would be formatted as US style dates by >default and if you added a different date format bead it would still >incorrectly display in US date format. Middle endian / US style dates >should not be the default as they are only used by about 5-10% of the >world’s population. If you prefer I can change the default to >"DD/MM/YYYY” rather than YYYY-MM-DD format (ISO 8601). > >Basically code like this would still display US style dates. ><js:DateField> > <js:beads> > <accessories:DateFormatDDMMYYYYBead /> > </js:beads> ></js:DateField> > >Reason being that it was just finding the first IFormatBead which was >defined in the CSS, any other IFormatBead bead the user added would be >ignored. That would imply a bug elsewhere DateField. The pattern all components should be using is to define an interface for a class of beads, maybe something like IDateFormatBead. 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. I noticed that there was a commit that changed the default date format away from US format. How did we manage the default format in regular Flex? -Alex