-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add calender or examples for start-date/time and end-date/time #39
Comments
|
First, per Django docs, by default the I haven't used it, but I think I have no idea how any of this handles time zones, though. There should also be third-party packages with date time picker widgets that are either more attractive or more user-friendly, but all I've found in minutes of Googling is stuff that hasn't been touched in years and broke several Django major versions ago. |
The default Here's the generated HTML: <tr>
<th><label>Start time:</label></th>
<td>
<input type="text" name="start_time_0" id="id_start_time_0"><input type="text" name="start_time_1" id="id_start_time_1">
</td>
</tr>
<tr>
<th><label>End time:</label></th>
<td>
<input type="text" name="end_time_0" id="id_end_time_0"><input type="text" name="end_time_1" id="id_end_time_1">
</td>
</tr> |
The second error is odd, because the field is marked as non-required in the form definition, but whatever. |
class HuntForm(forms.ModelForm):
start_time = forms.DateTimeField(widget=forms.DateTimeInput(attrs={"type": "datetime-local"}), required=False) ...makes the input display correctly, but it looks like the time comes through as UTC, not the user's local time. Also, this StackOverflow answer suggests this will break once editing existing hunts is implemented. The Django docs on time zones seem they like they should be able to help, but I don't know. It's possible the only solution is to ask for the user to specify the time zone when selecting the date/time, in which case the above isn't going to be sufficient. |
I think outputting all times in UTC or making everyone input things in UTC is acceptable enough. Timezones are a complicated mess and this feels like an easy way out for now. It's the standard timezone and will be easier to note "All timezones are in UTC" and punt implementing clever date-time conversions for the future. I'm personally okay if we never implement it either. |
… a calendar datepicker on modern browsers) for hunt start/end times
… a calendar datepicker on modern browsers) for hunt start/end times
#39: Use datetime-local inputs for hunt start/end times
Right now the hunt creation option just takes a start-date (and maybe also time). What format is not known (probably MM/DD/YYYY ugh)
The text was updated successfully, but these errors were encountered: