Django Datetime Widget

Usually I use datetimes as timestamps that are automatically set. Thus I do not need a datetime widget. But in my current project I needed a datetime widget that was user friendly. There are a few options. Which one was best?

The answer depends on what dependencies your project already has. For example, django-bootstrap3-datetimepicker seems pretty awesome. But I had trouble getting it to work with my project. I suspect part of the problem is I am using django-crispy (I am not sure this is the problem). Anyway, I am pretty comfortable with javascript, so I thought I would just download the javascript this app uses and wire it up my self with javascript. Then I found that I needed to download even more dependencies. So I decide to look around for something else.

That’s when I rediscovered a module by Trent Richardson (jquery-ui-timepicker-addon). I have used some of his modules in the past and had good luck. I am already using jquery. This module will not interfere with django-crispy. Turns out it worked great!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s