1 #include "../../lv_examples.h"
2 #if LV_USE_CALENDAR && LV_USE_CALENDAR_CHINESE && LV_BUILD_EXAMPLES
3 
lv_example_calendar_2(void)4 void lv_example_calendar_2(void)
5 {
6     lv_obj_t  * calendar = lv_calendar_create(lv_screen_active());
7     lv_obj_set_size(calendar, 300, 300);
8     lv_obj_align(calendar, LV_ALIGN_TOP_MID, 0, 0);
9 
10     lv_calendar_set_today_date(calendar, 2024, 03, 22);
11     lv_calendar_set_month_shown(calendar, 2024, 03);
12 
13 #if LV_USE_CALENDAR_HEADER_DROPDOWN
14     lv_calendar_header_dropdown_create(calendar);
15 #elif LV_USE_CALENDAR_HEADER_ARROW
16     lv_calendar_header_arrow_create(calendar);
17 #endif
18 
19     lv_calendar_set_chinese_mode(calendar, true);
20     lv_obj_set_style_text_font(calendar, &lv_font_simsun_14_cjk, LV_PART_MAIN);
21 }
22 
23 #else
24 
lv_example_calendar_2(void)25 void lv_example_calendar_2(void)
26 {
27     lv_obj_t * label = lv_label_create(lv_screen_active());
28     lv_label_set_text(label, "chinese calendar is not enabled");
29     lv_obj_center(label);
30 }
31 
32 #endif
33