mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-06 07:28:53 -05:00
fix: date picker in edit media (#1297)
By default, Django uses type=text for the date input, which respects the locale settings. However, when changing the input type to date, it should only accept YYYY-MM-DD format so the input field can be properly handled.
This commit is contained in:
parent
b6e46e7b62
commit
e8520bc7cd
@ -35,7 +35,7 @@ class MediaMetadataForm(forms.ModelForm):
|
|||||||
widgets = {
|
widgets = {
|
||||||
"new_tags": MultipleSelect(),
|
"new_tags": MultipleSelect(),
|
||||||
"description": forms.Textarea(attrs={'rows': 4}),
|
"description": forms.Textarea(attrs={'rows': 4}),
|
||||||
"add_date": forms.DateInput(attrs={'type': 'date'}),
|
"add_date": forms.DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'),
|
||||||
"thumbnail_time": forms.NumberInput(attrs={'min': 0, 'step': 0.1}),
|
"thumbnail_time": forms.NumberInput(attrs={'min': 0, 'step': 0.1}),
|
||||||
}
|
}
|
||||||
labels = {
|
labels = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user