Hi Chander,

On 13/07/2020 20.07, chander shekhar wrote:
#forms.py

classeventform(forms.ModelForm):

classMeta:

         model = Event

         fields = [, 'end_time',]

         widgets = {

'start_time':  forms.DateTimeInput(attrs={'type': 'datetime-local'}),


Look at the format attribute of DateTimeInput:

https://docs.djangoproject.com/en/3.0/ref/forms/widgets/#datetimeinput

and make sure it matches what is being sent by your template. I would probably test it by just printing out the value of start_time when submitting the form and go from there.

There might also be some thirdparty Django applications that can help you. Time is and time formats is a pain to work with.

Kind regards,

Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d907af69-2973-e383-497c-4af6a0e15277%40stacktrace.dk.

Reply via email to