Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. <html lang="en">
  2. <head>
  3.  
  4. <meta charset="utf-8">
  5. <title>DatePicker Example</title>
  6. <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  7. <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  8. <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  9. <script>
  10. $(function(){
  11. $(".to").datepicker({ dateFormat: 'yy-mm-dd' });
  12. $(".from").datepicker({ dateFormat: 'yy-mm-dd' }).bind("change",function(){
  13. var minValue = $(this).val();
  14. minValue = $.datepicker.parseDate("yy-mm-dd", minValue);
  15. minValue.setDate(minValue.getDate()+1);
  16. $("#to").datepicker( "option", "minDate", minValue );
  17. })
  18. });
  19. </script>
  20. </head>
  21. <body>
  22. <form method="post" action="">
  23. {{ form.hidden_tag() }}
  24. {{form.dt.label}} {{ form.dt(class="to") }}
  25. {{form.till.label}} {{ form.till(class="from") }}
  26. <button type="submit">Go</button>
  27. </form>
  28. </body>
  29. </html>
  30.  
  31. {% extends "base.html" %}
  32. {% block javascript %}
  33.  
  34. <link href="static/css/data.css" rel="stylesheet">
  35. <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  36. <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  37. <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  38. <script>
  39. $(function(){
  40. $(".to").datepicker({ dateFormat: 'yy-mm-dd' });
  41. $(".from").datepicker({ dateFormat: 'yy-mm-dd' }).bind("change",function(){
  42. var minValue = $(this).val();
  43. minValue = $.datepicker.parseDate("yy-mm-dd", minValue);
  44. minValue.setDate(minValue.getDate()+1);
  45. $("#to").datepicker( "option", "minDate", minValue );
  46. })
  47. });
  48. </script>
  49.  
  50. {% endblock %}
  51. {% block content %}
  52. <p> Demonstrates rendering data into a webpage</p>
  53.  
  54. <form method ="POST" action ="">
  55. {{form.hidden_tag() }}
  56. {{form.till.label}} {{ form.till(class="from") }}
  57. {{form.dt.label}} {{ form.dt(class="to") }}
  58.  
  59. {{form. animal_id.label}} {{form.animal_id}}
  60. {{form.submit()}}
  61. </form>
  62.  
  63. {{table}}
  64.  
  65. {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement