Localization and changing language without side-effects

Posted by: patrick-maurer on 14 September 2017, 12:12 pm EST

  • Posted 14 September 2017, 12:12 pm EST

    We use the following code to change the wijmo culture in our Angular4 app:

        private changeWijmoCulture(lang: string) {
            $.getScript('assets/i18n/wijmo/wijmo.culture.${lang}.js', () => {
                // invalidate all controls to show new culture
                Control.invalidateAll();
            });
        }

    This basically works concerning the localization.

    However, now we discovered that Control.InvalidateAll has side-effects in our forms. For instance, if we use a <wj-input-time> in our NgForm, the value changes from the current value to 00:00 and back to the current value.

    e.g. 08:30 -> 00:00 -> 08:30

    This leads to the NgForm becoming dirty, and also the <wj-input-time> gets the ng-dirty class added (and thus ng-prestine removed).

    Is this a bug? Or how is the recommended way to change the current culture for wijmo?

  • Posted 14 September 2017, 12:12 pm EST

    Hi,

    We are investigating this.

    Thanks,

    Manish Kumar Gupta

  • Posted 14 September 2017, 12:12 pm EST

    Hi Patrick,

    We are sorry for the delayed response. We are able to replicate the issue at our end and it looks like a bug. Hence, this issue has been escalated to the concerned team for further investigation with tracking id 279320.

    We will let you know as soon as we get any update on this issue.

    Thanks,

    Manish Kumar Gupta

  • Posted 3 November 2017, 5:48 am EST

    Hi Manish,

    is there any progress or feedback from the development team?

    Thanks,

    Patrick

  • Posted 8 January 2018, 8:46 am EST

    Hi Patrick,

    We are sorry for the late reply.

    by default InputTime accepts times whose minutes part should be multiple of 15. If minutes in the specified value are different then InputTime changes the value by itself to adjust it to 15 minutes boundary, this changed value is propagated back to the form, which becomes dirty.

    To workaroun it, the sample should specify InputTime.value whose minutes are multiple of 15, with the code like this:

    let ftime = new Date(),
    minutes = Math.floor(ftime.getMinutes() / 15) * 15;
    
    ftime.setMinutes(minutes);
    
     
    
    this.myForm= this.fb.group({
    ftime:[ftime],
    
    .......})
    

    Please refer to the attached sample.

    There was some issue with 5.20173.334 build. The issue has been fixed in 5.20172.349+.

    ~Manish

  • Posted 8 January 2018, 8:46 am EST

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels