HtmlDates Module

class epyk.core.html.HtmlDates.Calendar(page: PageModel, content: Optional[str], width: tuple, height: tuple, align: Optional[str], options: Optional[dict], html_code: Optional[str], profile: Optional[Union[bool, dict]])
click(js_funcs: Union[List[Union[str, JsDataModel]], str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False)

Add a click event to the Calendar component.

Parameters:
  • js_funcs – A Javascript Python function

  • profile – Optional. Set to true to profile or a function on the Js console

  • source_event – Optional. The source target for the event

  • on_ready – Optional. Specify if the event needs to be trigger when the page is loaded

property options: OptionDays

Property to set all the Calendar properties.

task(name: str, start: str, capacity: Union[List[float], float], end: Optional[str] = None, weekend: bool = False, options: Optional[dict] = None)
Parameters:
  • name – The task name

  • start – The task start date format YYYY-MM-DD

  • capacity – A figure in percentage

  • end – Optional. The task end date format YYYY-MM-DD

  • weekend – Optional. Flag to specify if the weekends should be considered

  • options – Optional. Specific Python options available for this component

weekly(name, start, capacity, frequency: int = 1, weekend: bool = False, options: Optional[dict] = None)
Parameters:
  • name

  • start

  • capacity

  • frequency

  • weekend – Optional. Flag to specify if the weekends should be considered.

  • options

class epyk.core.html.HtmlDates.CountDownDate(page: PageModel, day: int, month: int, year: int, hour: int, minute: int, second: int, label: Optional[str], icon: Optional[str], timestamp, width, height, html_code, helper, options, profile)
end(js_funcs: Union[List[Union[str, JsDataModel]], str], profile: Optional[Union[bool, dict]] = None)

Events triggered at the end of the timer.

Parameters:
  • js_funcs – Javascript functions

  • profile – Optional. A flag to set the component performance storage

class epyk.core.html.HtmlDates.DatePicker(page: PageModel, value, label: Optional[str], icon: Optional[str], width: tuple, height: tuple, color: Optional[str], html_code: Optional[str], profile: Optional[Union[bool, dict]], options: Optional[dict], helper: Optional[str])
add_options(options: Optional[dict] = None, name: Optional[str] = None, value: Optional[str] = None)

Add DatePicker options.

Related Pages:

Parameters:
  • options – Optional. Specific Python options available for this component

  • name – Optional. Python dictionary with the options to set

  • value – Optional. The option value

property dom: JsHtmlDateFieldPicker

The Javascript Dom proxy to the input object.

Usage:

today = page.ui.fields.today()
today.select([
  page.js.console.log(today.dom.content)
])
excluded_dates(dts: Optional[List[str]] = None, js_funcs: Optional[Union[List[Union[str, JsDataModel]], str]] = None, dataflows: Optional[List[dict]] = None, profile: Optional[Union[bool, dict]] = False)

Exclude some dates from the date picker selection.

Those dates will be visible but no available for selection.

Usage:

today = page.ui.fields.today()
today.excluded_dates(["2021-01-01"])
Parameters:
  • dts – Optional. A list of dates format YYYY-MM-DD

  • js_funcs – Optional. Javascript functions

  • profile – Optional. Set to true to get the profile for the function on the Javascript console

  • dataflows – Optional. Chain of data transformations

included_dates(dts: Optional[List[str]] = None, selected: Optional[str] = None, js_funcs: Optional[Union[List[Union[str, JsDataModel]], str]] = None, dataflows: Optional[List[dict]] = None, profile: Optional[Union[bool, dict]] = False)

Include some date to be available for selection.

All the other dates will be visible but not valid ones.

Usage:

today = page.ui.fields.today()
today.included_dates(["2021-01-01"])
Parameters:
  • dts – Optional. A list of dates format YYYY-MM-DD

  • selected – Optional. The selected date from the range. Default max

  • js_funcs – Optional. Javascript functions

  • profile – Optional. Set to true to get the profile or a function on the console

  • dataflows – Optional. Chain of data transformations

property options: OptionDatePicker

Property to set all the DatePicker properties.

select(js_funcs: Union[List[Union[str, JsDataModel]], str], profile: Optional[Union[bool, dict]] = None)

Event trigger when the DatePicker component changes.

Usage:

today = page.ui.fields.today()
today.select([
  page.js.console.log(today.dom.content)
])
Parameters:
  • js_funcs – The Javascript events when the DatePicker selection changes

  • profile – Optional. Set to true to get the profile for the function on the Javascript console

class epyk.core.html.HtmlDates.Elapsed(page: PageModel, day: int, month: int, year: int, label: Optional[str], icon: Optional[str], width: tuple, height: tuple, html_code: Optional[str], helper: Optional[str], options: Optional[dict], profile: Optional[Union[bool, dict]])
class epyk.core.html.HtmlDates.LastUpdated(page: PageModel, label: Optional[str], color: Optional[str], width: tuple, height: tuple, html_code: Optional[str], options: Optional[dict], profile: Optional[Union[bool, dict]])
property dom: JsHtmlRich

Return all the Javascript functions defined for an HTML Component.

Those functions will use plain javascript available for a DOM element by default.

Usage:

div = page.ui.div(htmlCode="testDiv")
print(div.dom.content)
Returns:

A Javascript Dom object.

property options: OptionsUpdate

Property to set all the DatePicker properties.

refresh()

Javascript shortcut to change the timestamp to this component.

Usage:

update = page.ui.rich.update()
update.click([
  update.refresh()
])
class epyk.core.html.HtmlDates.TimePicker(page: PageModel, value, label: Optional[str], icon: Optional[str], color: Optional[str], html_code: Optional[str], profile: Optional[Union[bool, dict]], options: Optional[dict], helper: Optional[str])
change(js_funcs: Union[List[Union[str, JsDataModel]], str], profile: Optional[Union[bool, dict]] = None, on_ready: bool = False)

Event triggered when the value of the input field changes.

A Date object containing the selected time is passed as the first argument of the callback. Note: the variable time is a function parameter received in the Javascript side.

Usage:

morning = page.ui.fields.time("8:13:00", label="Time field")
morning.change([
  page.js.alert("time", skip_data_convert=True)
])

Related Pages:

Parameters:
  • js_funcs – Javascript functions

  • profile – Optional. A flag to set the component performance storage

  • on_ready – Optional. Specify if the event needs to be trigger when the page is loaded

property dom: JsHtmlDateFieldPicker

The Javascript Dom proxy to the input object.

Usage:

time_picker = page.ui.fields.time()
time_picker.change([
  page.js.console.log(time_picker.dom.content)
])
class epyk.core.html.HtmlDates.Timer(page: PageModel, minutes: int, text: Optional[str], width: tuple, height: tuple, align: Optional[str], options: Optional[dict], html_code: Optional[str], profile: Optional[Union[bool, dict]])
end(js_funcs: Union[List[Union[str, JsDataModel]], str], profile: Optional[Union[bool, dict]] = None)

Events triggered at the end of the timer.

Parameters:
  • js_funcs – Javascript functions

  • profile – Optional. Set to true to get the profile for the function on the Javascript console