<script>
document.addEventListener('DOMContentLoaded', function () {
// getting the instance for the DatePicker and DatePickerFor after document content is loaded
datepicker = document.getElementById('datepicker').ej2_instances[0];
datepickerLocalized = document.getElementById('daterange').ej2_instances[0];
var L10n = ej.base.L10n;
L10n.load({
'hr': {
'datepicker': {
today: 'danas',
}
}
});
loadCultureFiles('hr');
// dynamically setting the locale property to the DatePicker in hr culture
datepicker.locale = 'hr';
datepickerLocalized.locale = 'hr';
});
function loadCultureFiles(name) {
//loading the required CLDR data files
var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json'];
var loader = ej.base.loadCldr;
var loadCulture = function (prop) {
var val, ajax;
ajax = new ej.base.Ajax(location.origin + location.pathname + '/../../Scripts/cldr-data/main/' + name + '/' + files[prop], 'GET', false);
ajax.onSuccess = function (value) {
val = value;
};
ajax.send();
loader(JSON.parse(val));
};
for (var prop = 0; prop < files.length; prop++) {
loadCulture(prop);
}
}
</script>
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - My ASP.NET Application</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
<script>
function loadCultureFiles(name) {
//loading the required CLDR data files
var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json'];
var loader = ej.base.loadCldr;
var loadCulture = function (prop) {
var val, ajax;
ajax = new ej.base.Ajax(location.origin + location.pathname + '/../../Scripts/cldr-data/main/' + name + '/' + files[prop], 'GET', false);
ajax.onSuccess = function (value) {
val = value;
};
ajax.send();
loader(JSON.parse(val));
};
for (var prop = 0; prop < files.length; prop++) {
loadCulture(prop);
}
}
loadCultureFiles('hr');
//globalizing all the EJ2 controls in the application
ej.base.setCulture('hr');
var L10n = ej.base.L10n;
L10n.load({
'hr': {
'datepicker': {
today: 'danas',
}
}
});
</script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("About", "About", "Home")</li>
<li>@Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>
</div>
</div>
</div>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
@RenderSection("PreScripts", required: false)
@Html.EJS().ScriptManager()
</body>
</html> |
document.addEventListener('DOMContentLoaded', function () {
// getting the instance for the DatePicker and DatePickerFor after document content is loaded
datepicker = document.getElementById('datepicker').ej2_instances[0];
datepickerLocalized = document.getElementById('daterange').ej2_instances[0];
var L10n = ej.base.L10n;
L10n.load({
'hr': {
'datepicker': {
today: 'danas',
}
}
});
loadCultureFiles('hr');
// dynamically setting the locale property to the DatePicker in hr culture
datepicker.locale = 'hr';
datepickerLocalized.locale = 'hr';
});
|