rename date to start time

stable
neingeist 6 years ago
parent 3f82634c30
commit d1703c8952

@ -3,6 +3,6 @@ from wtforms import DateTimeField, DecimalField, SubmitField
from wtforms.validators import DataRequired
class DownloadForm(FlaskForm):
date = DateTimeField('Date', validators=[DataRequired()])
start_time = DateTimeField('Start time', validators=[DataRequired()])
length = DecimalField('Length', validators=[DataRequired()])
submit = SubmitField('Download')

@ -7,7 +7,7 @@ from datetime import datetime, timedelta
def download():
form = DownloadForm()
if request.method == 'GET':
form.date.data = datetime.now() - timedelta(hours = 1)
form.start_time.data = datetime.now() - timedelta(hours = 1)
form.length.data = 60
elif form.validate_on_submit():
flash('The download should start immediately.')

@ -13,9 +13,9 @@
<form action="" method="post" novalidate>
{{ form.hidden_tag() }}
<p>
{{ form.date.label }}<br>
{{ form.date() }}<br>
{% for error in form.date.errors %}
{{ form.start_time.label }}<br>
{{ form.start_time() }}<br>
{% for error in form.start_time.errors %}
<span style="color: red;">[{{ error }}]</span>
{% endfor %}
</p>

Loading…
Cancel
Save