Calendar¶
Overview¶
Use Calendar to control date fields.
Make field¶
Collapsar will assume the field if you pass only pass 1 parameter. You can define the label and field name this way:
Fill method¶
Use fill to control the way the field will be assigned to the model. For example, to save it on another format.
def fill(self, request, model: "Model"):
"""Fill the field"""
setattr(
model,
self.attribute,
datetime.strptime(request.input(self.attribute), "%Y-%m-%dT%H:%M:%S.%fZ"),
Format date¶
Use format_value to display the date on a different format.