Giter Site home page Giter Site logo

Comments (4)

ollytheninja avatar ollytheninja commented on August 21, 2024

Hi James,
First, that looks great and I think many people would find it useful.
At the moment the original, non django specific version supports linking pickers https://eonasdan.github.io/bootstrap-datetimepicker/#linked-pickers but AFAIK it's not easy to do with this module.
I would love to see the implementation, could you create PR?

from django-datetime-widget.

ollytheninja avatar ollytheninja commented on August 21, 2024

I've been playing with this today with no luck, any chance you can publish your code?

from django-datetime-widget.

munnerz avatar munnerz commented on August 21, 2024

This is my code in use. This was merged in #60?

class ClipForm(forms.Form):
    start_datetime = forms.DateTimeField(widget=DateTimeWidget(usel10n=True, bootstrap_version=3, attrs={'label': "Start", "readonly": ''}))
    end_datetime = forms.DateTimeField(widget=DateTimeWidget(usel10n=True, bootstrap_version=3, attrs={'label': "End", "readonly": ''}))
    camera_name = forms.Field()

from django-datetime-widget.

munnerz avatar munnerz commented on August 21, 2024

Ah, or are you asking for the code used to make two boxes appear side by side like that?

This is as follows (taken straight from the project displayed above.. excuse the irrelevant parts)

  <div class="col-xs-12 col-sm-offset-1 col-sm-10">

    <div class="row">
      <form id="clip-form" action="{% url 'watch' %}" method="POST">
        {% csrf_token %}
        <div class="col-xs-12 col-sm-5">
          {{ search_form.start_datetime }}
        </div>

        <div class="col-xs-12 col-sm-5">
          {{ search_form.end_datetime }}
        </div>

        <input type="hidden" id="id_camera_name" name="camera_name" />

        <div class="col-xs-12 col-sm-2">
          <div class="btn-group pull-right">
            <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
              Watch <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" role="menu">
{% for c in cameras %}      
              <li onclick="$('#id_camera_name').val('{{ c }}'); $('#clip-form').submit()">
                <a href="#">{{ c }}</a>
              </li>
{% endfor %}
            </ul>
          </div>
        </div>

      </form>
    </div>
  </div>

from django-datetime-widget.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.