Skip to content

Show Lunar Dates #6111

@tongge666

Description

@tongge666

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch ant-design-vue@1.5.0-rc.6 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/ant-design-vue/es/vc-calendar/src/calendar/CalendarHeader.js b/node_modules/ant-design-vue/es/vc-calendar/src/calendar/CalendarHeader.js
index 5290209..4173e96 100644
--- a/node_modules/ant-design-vue/es/vc-calendar/src/calendar/CalendarHeader.js
+++ b/node_modules/ant-design-vue/es/vc-calendar/src/calendar/CalendarHeader.js
@@ -4,6 +4,7 @@ import { getOptionProps, getListeners } from '../../../_util/props-util';
 import MonthPanel from '../month/MonthPanel';
 import YearPanel from '../year/YearPanel';
 import DecadePanel from '../decade/DecadePanel';
+import calendarFormatter from '../../../../../../src/utils/dateChange'
 function noop() {}
 function goMonth(direction) {
   var next = this.value.clone();
@@ -133,10 +134,19 @@ var CalendarHeader = {
       } else {
         my = [year, month, day];
       }
+      let MonthCn = calendarFormatter.solar2lunar(value.format('YYYY'), value.format('MM'), value.format('DD')).IMonthCn
       return h(
         'span',
         { 'class': selectClassName },
-        [my]
+        [my, h(
+          'span',
+          {
+            style: {
+              fontSize: '12px'
+            }
+          },
+          ['(农历' + MonthCn + ')']
+        )]
       );
     },
     showMonthPanel: function showMonthPanel() {

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions