Skip to content

Commit

Permalink
fix(date-picker): change lunar npm package (#2073)
Browse files Browse the repository at this point in the history
  • Loading branch information
orime authored Dec 12, 2024
1 parent ce2a2e1 commit 1d12f6a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/zent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/zent/src/date-picker/demos/lunar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
2 changes: 1 addition & 1 deletion packages/zent/src/date-picker/panels/date-panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion packages/zent/src/date-picker/utils/getPanelCellsData.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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();

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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==

[email protected]:
version "6.11.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
Expand Down

0 comments on commit 1d12f6a

Please sign in to comment.