We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

When setting locale, the placeholder is not respecting the placeholder property value

In the createInput method of the DatePicker, the placeholder property is set from l10n only if no placeholder property is currently set:

if (this.getModuleName() === 'datepicker') {
var l10nLocale = { placeholder: null };
this.globalize = new Internationalization(this.locale);
this.l10n = new L10n('datepicker', l10nLocale, this.locale);
this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);
}

If you then subsequently call the global setCulture() method; the onPropertyChanged method of the DatePicker is ignoring the explicitly set placeholder value.

case 'locale':
this.globalize = new Internationalization(this.locale);
this.l10n.setLocale(this.locale);
this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);

This seems like inconsistent handling

1 Reply

AB Ashokkumar Balasubramanian Syncfusion Team April 4, 2019 01:21 PM UTC

Hi Grant, 
 
We have checked with your query and we would like to let you know that our DatePicker component will be rendered based on the place holder value set initially through “placeholder” ‌API. While change the locale at the run time, it will accept the placeholder value set through “L10.load” method. This is the default behavior of the DatePicker component. 
 
If you want the initial time DatePicker behavior for run time, you don’t specify the placeholder value in L10.load method.  
 
Please let us know, if you have any concerns on this. 
 
Regards, 
Ashokkumar b. 


Loader.
Live Chat Icon For mobile
Up arrow icon