Commit 7bfbffcb authored by David Haynes's avatar David Haynes 🙆

Merge branch 'issue#65' into 'master'

Changed the DateTimerPicker() in forms.py to update time appropriately. (Closes Issue#65)

Changed 'default=datetime.date.now() + timedelta(day=1)'
to  'default=lambda: datetime.date.now() + timedelta(day = 1)'

Also tested it after the day had changed.
![issue65](/uploads/bc93889f610c89b93c7ddf8013422166/issue65.png)

See merge request !32
parents d9adf4d3 838a7fbc
Pipeline #358 passed with stage
in 3 minutes and 43 seconds
......@@ -12,8 +12,7 @@ from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit, HTML, Div, Field
from crispy_forms.bootstrap import StrictButton, PrependedText, Accordion, AccordionGroup
from bootstrap3_datetime.widgets import DateTimePicker
import datetime
from datetime import date
from datetime import date, datetime, timedelta
class URLForm(forms.ModelForm):
......@@ -89,11 +88,11 @@ class URLForm(forms.ModelForm):
label='Custom Date',
input_formats=['%m-%d-%Y'],
validators=[valid_date],
initial=lambda: datetime.now() + timedelta(days=1),
widget=DateTimePicker(
options={
"format": "MM-DD-YYYY",
"pickTime": False,
"defaultDate": (datetime.date.today() + datetime.timedelta(hours=24)).strftime("%m-%d-%Y"),
},
icon_attrs={
"class": "fa fa-calendar",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment