@view_config(renderer="templates/form.pt", name="datetimeinput")
@demonstrate("DateTime Input Widget")
def datetimeinput(self):
import datetime
class Schema(colander.Schema):
date_time = colander.SchemaNode(
colander.DateTime(),
validator=colander.Range(
min=datetime.datetime(
datetime.date.today().year,
1,
1,
12,
30,
tzinfo=iso8601.UTC,
),
min_err=_(
"${val} is earlier than earliest datetime ${min}"
),
),
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)