forked from certsocietegenerale/FIR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace datetimepicker by corresponding HTML5 inputs
- Loading branch information
1 parent
8240ec7
commit 3c2b805
Showing
12 changed files
with
35 additions
and
1,871 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from django import forms | ||
|
||
class DateTimeLocalInput(forms.DateTimeInput): | ||
input_type = "datetime-local" | ||
|
||
class DateTimeLocalField(forms.DateTimeField): | ||
# Set DATETIME_INPUT_FORMATS here because, if USE_L10N | ||
# is True, the locale-dictated format will be applied | ||
# instead of settings.DATETIME_INPUT_FORMATS. | ||
# See also: | ||
# https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats | ||
|
||
input_formats = [ | ||
"%Y-%m-%dT%H:%M:%S", | ||
"%Y-%m-%dT%H:%M:%S.%f", | ||
"%Y-%m-%dT%H:%M", | ||
] | ||
widget = DateTimeLocalInput(format="%Y-%m-%dT%H:%M") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.