- Author:
 - caa
 - Posted:
 - November 19, 2011
 - Language:
 - HTML/template
 - Version:
 - 1.3
 - Score:
 - 0 (after 0 ratings)
 
Based on code from mihelac.org
Modified to work in Django 1.3.1. Put it in templates/admin/app_label/model/change_form.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  | {% extends "admin/change_form.html" %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript">
django.jQuery(window).load(function() {
    django.jQuery('.timelist').each(function(num, el) {
        time_format = get_format('TIME_INPUT_FORMATS')[0];
        django.jQuery(el).html('');
        for (i=8; i<20; i++) {
          var time = new Date(1970,1,1,i,0,0);
          lnk = "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '" + time.strftime(time_format) + "');"
          /*django.jQuery(el).append('<li><a href="'lnk'">' + time.strftime('%H:%M') + '</a></li>');*/
          django.jQuery(el).append('<li><a href="' + lnk + '">' + time.strftime(time_format) + '</a></li>');
        }
    });
});
</script>
{% endblock %}
 | 
More like this
- Bootstrap Accordian by Netplay4 6 years, 9 months ago
 - Bootstrap theme for django-endless-pagination? by se210 9 years, 9 months ago
 - Bootstrap theme for django-endless-pagination? by se210 9 years, 9 months ago
 - Reusable form template with generic view by roldandvg 9 years, 11 months ago
 - Pagination Django with Boostrap by guilegarcia 10 years ago
 
Comments
Everything works for me except when I click the date from dopdown It does not fill the input field.. It gives some weired value like NaNaNa something like this..
How to solve this ??
#
Please login first before commenting.