Is there a 'SelectDateTime' widget for django forms?
问题 Basically the same as the SelectDate Widget but with an hour component as well. Can't seem to find one in the official docs? 回答1: Here's the split date/time widget I use: First, the Time widget. There's a LOT of code. I'm copy/pasting here, so there may be imports you don't need. I keep this in a file called "custom_form_widgets.py". At the bottom, you'll see my "FriendlySplitDateTimeWidget" class, which you can use in your forms. The hours can be based on a 24 or 12 hour clock. The date