Monday, October 3, 2016

Adding date and time picker



[code]
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css" />
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="col-md-2">
        <asp:TextBox ID="txtSessiontime" runat="server" CssClass="form-control" Width="200px" />
        <script type="text/javascript">
            $(function () {

                $("[id$=txtSessiontime]").daterangepicker({
                    singleDatePicker: true,
                    timePicker: true,
                    timePickerIncrement: 15,
                    locale: {
                        format: 'DD-MM-YYYY h:mm A'
                    }
                });
            });
        </script>
    </div>
[/code]

No comments:

Post a Comment