BoldSign®Effortlessly integrate e-signatures into your app with the BoldSign® API. Create a sandbox account!
@Component({
selector: 'ej-app',
templateUrl: './home.component.html',
})
export class HomeComponent {
public locale: string;
public dateObjest : any;
constructor() {
this.locale = "fr-FR";
this.loadDynmicallyScript(this.locale);
}
public loadDynmicallyScript(locale: String) {
/* loading culture and culture text file*/
var locale_script = document.createElement('script');
locale_script.src = "../node_modules/syncfusion-ej-global-all/l10n/ej.localetexts." + locale + ".min.js";
locale_script.async = false;
document.head.appendChild(locale_script);
var script = document.createElement('script');
script.async = false;
script.src = "../node_modules/syncfusion-ej-global-all/i18n/ej.culture." + locale + ".min.js";
document.head.appendChild(script);
script.onload = function () {
$(".e-datepicker").data("ejDatePicker").option("locale", locale);
}
}
} |
public loadDynmicallyScript(locale: String) {
/*removing the duplicate script rendering process*/
if($("#localeScript").length > 0 || $("#cultureScript").length > 0)
{
$("#localeScript").remove();
$("#cultureScript").remove();
}
/* loading culture and culture text file*/
var locale_script = document.createElement('script');
locale_script.setAttribute("id","localeScript");
locale_script.src = "../node_modules/syncfusion-ej-global-all/l10n/ej.localetexts." + locale + ".min.js";
locale_script.async = false;
document.head.appendChild(locale_script);
var script = document.createElement('script');
script.setAttribute("id","cultureScript");
script.async = false;
script.src = "../node_modules/syncfusion-ej-global-all/i18n/ej.culture." + locale + ".min.js";
document.head.appendChild(script);
script.onload = function () {
$(".e-datepicker").data("ejDatePicker").option("locale", locale);
}
} |