diff --git a/packages/zent/package.json b/packages/zent/package.json index 09db69ea6..5bcd969fd 100644 --- a/packages/zent/package.json +++ b/packages/zent/package.json @@ -45,8 +45,8 @@ "big.js": "^6.1.1", "classnames": "^2.2.6", "date-fns": "^2.7.0", - "lunar-typescript": "^1.6.10", "observable-hooks": "4.2.0", + "pure-lunar-typescript": "^1.0.0", "react-is": "^17.0.1", "react-transition-group": "^4.4.1", "rxjs": "^7.1.0", diff --git a/packages/zent/src/date-picker/demos/lunar.md b/packages/zent/src/date-picker/demos/lunar.md index a5801ced6..528bac9fb 100644 --- a/packages/zent/src/date-picker/demos/lunar.md +++ b/packages/zent/src/date-picker/demos/lunar.md @@ -10,7 +10,7 @@ en-US: import { DatePicker } from 'zent'; import { useState } from 'react'; -import { Lunar } from 'lunar-typescript'; +import { Lunar } from 'pure-lunar-typescript'; class LunarDatePickerDemo extends Component { state = {}; diff --git a/packages/zent/src/date-picker/panels/date-panel/index.tsx b/packages/zent/src/date-picker/panels/date-panel/index.tsx index 38535e970..8ac842114 100644 --- a/packages/zent/src/date-picker/panels/date-panel/index.tsx +++ b/packages/zent/src/date-picker/panels/date-panel/index.tsx @@ -13,7 +13,7 @@ import usePanelDate from '../../hooks/usePanelDate'; import { ISinglePanelProps, IDisabledTime, IShowTime } from '../../types'; import { useEventCallbackRef } from '../../../utils/hooks/useEventCallbackRef'; -import { Lunar } from 'lunar-typescript'; +import { Lunar } from 'pure-lunar-typescript'; export interface IDatePickerPanelProps extends ISinglePanelProps { disableRangeOverView?: boolean; diff --git a/packages/zent/src/date-picker/utils/getPanelCellsData.ts b/packages/zent/src/date-picker/utils/getPanelCellsData.ts index 19063b92c..03b05c86f 100644 --- a/packages/zent/src/date-picker/utils/getPanelCellsData.ts +++ b/packages/zent/src/date-picker/utils/getPanelCellsData.ts @@ -1,6 +1,6 @@ import { eachDayOfInterval, isAfter, isBefore, isSameDay } from 'date-fns'; import { IDateCellBase, IGenerateDateConfig, DateTuple } from '../types'; -import { Lunar } from 'lunar-typescript'; +import { Lunar } from 'pure-lunar-typescript'; interface ICellDateParams { selected: Date | null; @@ -53,6 +53,7 @@ export default function getPanelCellsData({ const date = currentDate as any; const d = Lunar.fromDate(date); + const lunarDay = d.getDayInChinese(); const solarTerm = d.getJieQi(); diff --git a/yarn.lock b/yarn.lock index 8e433c003..27ae89d17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7398,11 +7398,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lunar-typescript@^1.6.10: - version "1.6.10" - resolved "https://registry.npmmirror.com/lunar-typescript/-/lunar-typescript-1.6.10.tgz#607b5d6821efb48c0ff751a79859b1dfeb39c7a6" - integrity sha512-NpimyKWfxaYbUPJIdHcDX5iaXSMbQVob2yk4Baox9KMwCNLrLsjNk/sS92fAlqTkziKkvM/39rPxk4qXX7gWaA== - lunr@^2.3.9: version "2.3.9" resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" @@ -9474,6 +9469,11 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +pure-lunar-typescript@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pure-lunar-typescript/-/pure-lunar-typescript-1.0.0.tgz#893389ede8d1f80d843bb0cd7063396e6afa3fcf" + integrity sha512-CkfUPkJ/SyNRNRAksK03cCivPCmf6BWd3MrdmgqJeEGVuT+jXawAqFYS4F8ZerkOTCTsJmlQ1pD68ABPAkmH6w== + qs@6.11.0: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"