Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>DatePicker Example</title>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
- <script src="//code.jquery.com/jquery-1.10.2.js"></script>
- <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
- <script>
- $(function(){
- $(".to").datepicker({ dateFormat: 'yy-mm-dd' });
- $(".from").datepicker({ dateFormat: 'yy-mm-dd' }).bind("change",function(){
- var minValue = $(this).val();
- minValue = $.datepicker.parseDate("yy-mm-dd", minValue);
- minValue.setDate(minValue.getDate()+1);
- $("#to").datepicker( "option", "minDate", minValue );
- })
- });
- </script>
- </head>
- <body>
- <form method="post" action="">
- {{ form.hidden_tag() }}
- {{form.dt.label}} {{ form.dt(class="to") }}
- {{form.till.label}} {{ form.till(class="from") }}
- <button type="submit">Go</button>
- </form>
- </body>
- </html>
- {% extends "base.html" %}
- {% block javascript %}
- <link href="static/css/data.css" rel="stylesheet">
- <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
- <script src="//code.jquery.com/jquery-1.10.2.js"></script>
- <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
- <script>
- $(function(){
- $(".to").datepicker({ dateFormat: 'yy-mm-dd' });
- $(".from").datepicker({ dateFormat: 'yy-mm-dd' }).bind("change",function(){
- var minValue = $(this).val();
- minValue = $.datepicker.parseDate("yy-mm-dd", minValue);
- minValue.setDate(minValue.getDate()+1);
- $("#to").datepicker( "option", "minDate", minValue );
- })
- });
- </script>
- {% endblock %}
- {% block content %}
- <p> Demonstrates rendering data into a webpage</p>
- <form method ="POST" action ="">
- {{form.hidden_tag() }}
- {{form.till.label}} {{ form.till(class="from") }}
- {{form.dt.label}} {{ form.dt(class="to") }}
- {{form. animal_id.label}} {{form.animal_id}}
- {{form.submit()}}
- </form>
- {{table}}
- {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement