# lv_calendar_chinese.h (/api/widgets/calendar/lv_calendar_chinese_h)



<ApiSummary functions="3" structs="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (1)&#x22;,&#x22;Getters (1)&#x22;,&#x22;Other (1)&#x22;]">
  <ApiTab value="Setters (1)">
    <ApiMember kind="function" name="lv_calendar_set_chinese_mode" file="widgets/calendar/lv_calendar_chinese.h" line="42" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/calendar/lv_calendar_chinese.h#L42">
      lv_calendar_set_chinese_mode [#lv_calendar_set_chinese_mode]

      Enable the chinese calendar.

      ```c title=" " lineNumbers=1
      void lv_calendar_set_chinese_mode(lv_obj_t *obj, bool en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                                   |
      | ----- | ------------------------------------------------ | --------------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a calendar object.                 |
      | `en`  | <ApiLink name="bool" />                          | true: enable chinese calendar; false: disable |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (1)">
    <ApiMember kind="function" name="lv_calendar_get_day_name" file="widgets/calendar/lv_calendar_chinese.h" line="49" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/calendar/lv_calendar_chinese.h#L49">
      lv_calendar_get_day_name [#lv_calendar_get_day_name]

      Get the name of the day

      ```c title=" " lineNumbers=1
      const char * lv_calendar_get_day_name(lv_calendar_date_t *gregorian)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type                                                                 | Description                               |
      | ----------- | -------------------------------------------------------------------- | ----------------------------------------- |
      | `gregorian` | <ApiLink name="lv_calendar_date_t" display="lv_calendar_date_t *" /> | to obtain the gregorian time for the name |

      **Returns:** `const char *` — return the name of the day
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (1)">
    <ApiMember kind="function" name="lv_calendar_gregorian_to_chinese" file="widgets/calendar/lv_calendar_chinese.h" line="56" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/calendar/lv_calendar_chinese.h#L56">
      lv_calendar_gregorian_to_chinese [#lv_calendar_gregorian_to_chinese]

      Get the chinese time of the gregorian time (reference: [https://www.cnblogs.com/liyang31tg/p/4123171.html](https://www.cnblogs.com/liyang31tg/p/4123171.html))

      ```c title=" " lineNumbers=1
      void lv_calendar_gregorian_to_chinese(lv_calendar_date_t *gregorian_time, lv_calendar_chinese_t *chinese_time)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name             | Type                                                                       | Description                                       |
      | ---------------- | -------------------------------------------------------------------------- | ------------------------------------------------- |
      | `gregorian_time` | <ApiLink name="lv_calendar_date_t" display="lv_calendar_date_t *" />       | need to convert to chinese time in gregorian time |
      | `chinese_time`   | <ApiLink name="lv_calendar_chinese_t" display="lv_calendar_chinese_t *" /> | the chinese time convert from gregorian time      |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Structs [#structs]

<ApiMember kind="struct" name="lv_calendar_chinese_t">
  lv_calendar_chinese_t [#lv_calendar_chinese_t]

  | Member       | Type                                  | Description |
  | ------------ | ------------------------------------- | ----------- |
  | `today`      | <ApiLink name="lv_calendar_date_t" /> |             |
  | `leep_month` | <ApiLink name="bool" />               |             |
</ApiMember>

<TypeUsedBy name="lv_calendar_chinese_t" count="1">
  * `lv_calendar_gregorian_to_chinese` — param `chinese_time`
</TypeUsedBy>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_obj.h&#x22;, &#x22;lv_calendar.h&#x22;]" includedBy="[&#x22;lv_calendar.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_buttonmatrix.h&#x22;, &#x22;lv_calendar_header_arrow.h&#x22;, &#x22;lv_calendar_header_dropdown.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property.h&#x22;, &#x22;lv_obj_property_names.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
