Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
1
Share

DateParam

Param for a date, or a datetime when include_time is True.

Values are stored as ISO 8601 strings:

  • "2026-05-13" when include_time is False
  • "2026-05-13T14:30:00" when include_time is True

The interface uses additional_info.include_time to pick between a date picker and a datetime picker.

Accepted input types for default_value, min_value, max_value and values passed to :meth:validate:

  • an ISO 8601 string
  • a :class:datetime.date or :class:datetime.datetime instance
Attributes
PRIVATE_VISIBILITY: LiteralPROTECTED_VISIBILITY: LiteralPUBLIC_VISIBILITY: Literaladditional_info: dict | Nonedefault_value: Optionalhuman_name: str | Noneinvalid_reason: str | Noneis_valid: booloptional: boolshort_description: str | Nonevisibility: Literal
Functions
__init__
default_value : str | datetime.date | datetime.datetime | None
Default value, if None, and optional is false, the config is mandatory. Setting optional to True, allows default None value.
include_time : bool - False
If True, the param accepts a full datetime; otherwise a date only.
min_value : str | datetime.date | datetime.datetime | None
Minimum allowed value (inclusive).
max_value : str | datetime.date | datetime.datetime | None
Maximum allowed value (inclusive).
optional : bool - False
See default value.
visibility : Literal - public
Visibility of the param, see doc on type ParamSpecVisibilty for more info.
human_name : str | None
Human readable name of the param, showed in the interface.
short_description : str | None
build

Convert the stored ISO 8601 string back to a :class:datetime.date (or :class:datetime.datetime when include_time is True) before the value is used in a task.

The stored value is unchanged.

value : Any
Return type : datetime.date | datetime.datetime | None
get_default_value
Return type : Any
to_dto
Return type : ParamSpecDTO
to_simple_dto
Return type : ParamSpecSimpleDTO
validate

Validate the value of the param and return the modified value if needed. This method is called when the param is set in the config before saving it in the database. The returned value must be serializable in json.

value : Any
Return type : str | None
empty @classmethod
Return type : ParamSpec
get_param_spec_type @classmethod
Return type : ParamSpecType
load_from_dto @classmethod

Override to re-validate min_value / max_value carried in the DTO.

Strict-write, lenient-read: only re-validate the bounds when validate is True. When False (the default, used to load persisted content), copy additional_info verbatim so that a previously-stored malformed bound does not block read-modify-write operations like deleting the field.

spec_dto : ParamSpecDTO
validate : bool - False
Return type : DateParam
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.