codice HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<title>Document</title>
</head>
<body>
<form action="#" method="post">
<input type="text" id="id_class_data_presunta_spedizione" value="">
</form>
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<!-- <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script> -->
<script>
$(document).ready(function () {
/* Italian initialisation for the jQuery UI date picker plugin. */
/* Written by Antonello Pasella (antonello.pasella@gmail.com). */
(function (factory) {
"use strict";
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
define(["../widgets/datepicker"], factory);
} else {
// Browser globals
factory(jQuery.datepicker);
}
})(function (datepicker) {
"use strict";
datepicker.regional.it = {
closeText: "Chiudi",
prevText: "Prec",
nextText: "Succ",
currentText: "Oggi",
monthNames: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno",
"Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
monthNamesShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu",
"Lug", "Ago", "Set", "Ott", "Nov", "Dic"],
dayNames: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"],
dayNamesShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"],
dayNamesMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa"],
weekHeader: "Sm",
dateFormat: "dd/mm/yy",
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ""
};
datepicker.setDefaults(datepicker.regional.it);
return datepicker.regional.it;
});
$(function () {
$("#id_class_data_presunta_spedizione").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'dd-mm-yy',
yearRange: "2010:2040"
});
});
})
</script>
</body>
</html>