lv_calendar.h

API reference for lv_calendar.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_calendar_private.h

Functions

lv_calendar_set_today_date

Set the today's year, month and day at once

 
void lv_calendar_set_today_date(lv_obj_t *obj, uint32_t year, uint32_t month, uint32_t day)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a calendar object
yearuint32_ttoday's year
monthuint32_ttoday's month [1..12]
dayuint32_ttoday's day [1..31]

lv_calendar_set_today_year

Set the today's year

 
void lv_calendar_set_today_year(lv_obj_t *obj, uint32_t year)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a calendar object
yearuint32_ttoday's year

lv_calendar_set_today_month

Set the today's year

 
void lv_calendar_set_today_month(lv_obj_t *obj, uint32_t month)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a calendar object
monthuint32_ttoday's month [1..12]

lv_calendar_set_today_day

Set the today's year

 
void lv_calendar_set_today_day(lv_obj_t *obj, uint32_t day)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a calendar object
dayuint32_ttoday's day [1..31]

lv_calendar_set_month_shown

Set the currently shown year and month at once

 
void lv_calendar_set_month_shown(lv_obj_t *obj, uint32_t year, uint32_t month)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a calendar object
yearuint32_tshown year
monthuint32_tshown month [1..12]

lv_calendar_set_shown_year

Set the currently shown year

 
void lv_calendar_set_shown_year(lv_obj_t *obj, uint32_t year)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a calendar object
yearuint32_tshown year

lv_calendar_set_shown_month

Set the currently shown month

 
void lv_calendar_set_shown_month(lv_obj_t *obj, uint32_t month)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a calendar object
monthuint32_tshown month [1..12]

lv_calendar_set_highlighted_dates

Set the highlighted dates

 
void lv_calendar_set_highlighted_dates(lv_obj_t *obj, lv_calendar_date_t highlighted[], size_t date_num)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a calendar object
highlightedlv_calendar_date_tpointer to an lv_calendar_date_t array containing the dates. Only the pointer will be saved so this variable can't be local which will be destroyed later.
date_numsize_tnumber of dates in the array

lv_calendar_set_day_names

Set the name of the days

 
void lv_calendar_set_day_names(lv_obj_t *obj, const char **day_names)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a calendar object
day_namesconst char **pointer to an array with the names. E.g. const char * days[7] = {"Sun", "Mon", ...} Only the pointer will be saved so this variable can't be local which will be destroyed later.

Structs

struct

lv_calendar_date_t

Represents a date on the calendar object (platform-agnostic).

MemberTypeDescription
yearuint16_t
monthuint8_t1..12
dayuint8_t1..31
Used by 4 functions
  • lv_calendar_set_highlighted_dates — param highlighted
  • lv_calendar_get_pressed_date — param date
  • lv_calendar_get_day_name — param gregorian
  • lv_calendar_gregorian_to_chinese — param gregorian_time

Variables

lv_calendar_class

 
const lv_obj_class_t lv_calendar_class

Dependencies

How is this guide?

Last updated on

On this page