Or a better option is to use a third party app such as 
https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/index.html

On Friday, June 7, 2019 at 1:05:04 PM UTC-5, Joe Reitman wrote:
>
> Try this:
>
> in settings.py
>
> USE_L10N = False
>
> USE_TZ = True
>
> DATE_INPUT_FORMATS = ['%B %d, %Y']
>
>
> In forms.py
>
> start_date = forms.DateField(
>     widget=forms.DateInput(attrs={'placeholder': 'October 24, 2019'}),
> )
>
>
> On Friday, June 7, 2019 at 5:36:30 AM UTC-5, Dube Software wrote:
>>
>> Hi,
>>
>> I have a form with a start_date field of type DateField (widget is 
>> DateInput).
>>
>> When I specify a format argument, the input does not render as specified. 
>> The format is always YYYY-MM-DD. My code is as follows:
>>
>> ```
>> start_date = forms.DateField(
>> label='Start date',
>> widget=forms.widgets.DateInput(
>> format='%d %B, %Y',
>> attrs = {
>> 'type': 'date',
>> }
>> )
>> )
>> ```
>> What am I missing?
>>
>> Kind regards,
>> Lloyd
>>
>> *Sent with Shift 
>> <https://tryshift.com/?utm_source=SentWithShift&utm_campaign=Sent%20with%20Shift%20Signature&utm_medium=Email%20Signature&utm_content=General%20Email%20Group>*
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/28af33d7-359a-499e-9576-2729fc742ce8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to