Added Calendar widget support from jQuery UI plugin for registration fields.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Thu, 20 Jan 2011 01:37:44 +0530
changeset 480 d0325456f266
parent 479 fdaf0d8ceb53
child 481 b93a85589490
Added Calendar widget support from jQuery UI plugin for registration fields.
pytask/templates/profile/edit.html
pytask/templates/registration/registration_form.html
--- a/pytask/templates/profile/edit.html	Thu Jan 20 01:36:37 2011 +0530
+++ b/pytask/templates/profile/edit.html	Thu Jan 20 01:37:44 2011 +0530
@@ -2,6 +2,23 @@
 
 {% load form_helpers %}
 
+{% block js %}
+<script type="text/javascript">
+  $(document).ready(function () {
+    $("#id_dob").datepicker({
+      dateFormat: 'yy-mm-dd',
+      changeMonth: true,
+      changeYear: true,
+      minDate: "-90y",
+      maxDate: "+0D",
+      yearRange: "-90",
+      defaultDate: '1985-01-01'
+    });
+  });
+</script>
+{% endblock %}
+
+
 {% block content %}
   {% as_div_form form "Edit Profile Form" csrf_token "Update" %}
 {% endblock %}
--- a/pytask/templates/registration/registration_form.html	Thu Jan 20 01:36:37 2011 +0530
+++ b/pytask/templates/registration/registration_form.html	Thu Jan 20 01:37:44 2011 +0530
@@ -2,6 +2,24 @@
 
 {% load form_helpers %}
 
+
+{% block js %}
+<script type="text/javascript">
+  $(document).ready(function () {
+    $("#id_dob").datepicker({
+      dateFormat: 'yy-mm-dd',
+      changeMonth: true,
+      changeYear: true,
+      minDate: "-90y",
+      maxDate: "+0D",
+      yearRange: "-90",
+      defaultDate: '1985-01-01'
+    });
+  });
+</script>
+{% endblock %}
+
+
 {% block content %}
   {% url registration_register as registration_url %}
   {% as_div_form form "Create Profile Form" csrf_token "Submit" registration_url %}