Menu ▼



Posted By :
avatarmrkraju
Total Views : 376

Show week of the year in jQuery datepicker

This example shows you how to display the week of the year in jQuery datepicker. To show week of the year we need to set the showWeek property value as "true".

Note: The first week of the year contains the first Thursday of the year.

Example
Date :

<script language="javascript">
    $(document).ready(function () {
        $("#txtdate").datepicker({
            showWeek: true,
            firstDay: 1
        });
    });
</script>


Source code

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" rel="Stylesheet"
        type="text/css" />
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
    <script language="javascript">
        $(document).ready(function () {
            $("#txtdate").datepicker({
                showWeek: true,
                firstDay: 1
            });
        });
    </script>
</head>
<body>
    Date :
    <input id="txtdate" type="text">
</body>
</html>






comments powered by Disqus


Search dotnetlearners.com