Hi hello to all!
I have this date pick form that allow the user to pick a date, send it to the server and then update the data in the dashboard.
forms.py
# update saldo refence date
class SaldoRefDate(forms.Form):
refDate = forms.DateField(
label='Ref. Date',
required=True,
widget=forms.DateInput(format="%Y-%m-%d", attrs={'type': 'date'}),
input_formats=["%Y-%m-%d"],
initial= datetime.now().strftime("%Y-%m-%d")
)
Turns out that the initial date does not change dinamicaly, it stay’s stuck at the server’s deploy date.
I’ve tryed to use some JQuery to force the actual date on page load but, when the user change to any other date causes the page to reload and then, jQquery does his magic again and we ended stuck in todays date…
Is there any solution to this?
Thanks in advance.