Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django DateTimeField with optional time part

I have a field which will represent the start time of an event and I am using the Django DateTimeField for this. This field is mandatory but sometimes the users will only know the start date and not the time. Is there anyway to make the time part optional and keep the date part mandatory?

like image 672
SteveC Avatar asked May 31 '26 23:05

SteveC


1 Answers

Maybe you should try to separate date from time. There are DateField and TimeField for that.

like image 98
Dmitrii Mikhailov Avatar answered Jun 02 '26 18:06

Dmitrii Mikhailov