Comments (4)
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.
I've been playing with this today with no luck, any chance you can publish your code?
from django-datetime-widget.
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.
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)
- Change icons HOT 1
- using Now as startDate HOT 1
- Duplicate ID in rendered widgets
- Time Disabled
- Use display names configured in user settings instead of usernames (if provided)
- Date format conversion to python miss many formats
- startDate and endDate Options
- Improve documentation
- Not working in Django 2.1 HOT 4
- Readme > format doesn't show available month options
- Suggestion for Django 1.8+: DurationWidget
- startDate, endDate and daysOfWeekDisabled not working HOT 2
- Back to 1899 HOT 7
- todayBtn needs to be added to boolean list HOT 1
- Add option to not style input as readonly HOT 3
- Next month, Prev month buttons not showing HOT 1
- Blackout dates, hours
- Inconsistency with boolean values HOT 1
- Multiple widgets in a single form HOT 1
- Error on Django 1.10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-datetime-widget.