Open balinabbb opened 7 years ago
I'm having this same problem. I have the following options in my form:
datetime_widget_opts = {
'startDate': str(timezone.now())
}
...
datefield = forms.DateTimeField(label="Start Date",
widget=DateTimeWidget(
usel10n=True,
bootstrap_version=3,
options=datetime_widget_opts
)
)
...
But, the widget still lets me pick dates in the past. Looking through the JS it seems startDate
is the right parameter but I wonder if timezone.now()
isn't in the right format, but the docs don't say how it should be. What format should startDate
and endDate
be in the config?
Hi,
I would like to use create a picker which won't accept past dates. This would be the correct syntax to make it possible. However beacuse of this and this line I can't use that sytax. If I use datetime.now() in django, that now will be the now of the backend application launch, and not the client side page load.
I commented this line, which solved my problem, but do you have some better idea? I have some solutions in mind if you are interested.