I am trying to localize datepicker and I can't fully understand where each code block should be.
In a view I have a script:
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/jquery-ui.js"></script>
<script type="text/javascript" src="https://raw.githubusercontent.com/jquery/jquery-ui/master/ui/i18n/datepicker-lv.js"></script>
<link href="~/Content/themes/custom/jquery-ui.css" rel="stylesheet" />
<script>
$(function() {
$('#datepicker').datepicker(
$.datepicker.regional["lv"]
);
});
</script>
It has to be working with this text box in a same view:
<tr>
<td align="left">@Html.LabelFor(m => m.TestDate)</td>
<td align="left">@Html.TextBoxFor(m => m.TestDate, new { id = "datepicker", style = "width:200px"})</td>
</tr>
What is missing in that code?