ํ๊ตญ ์ฌ์ฃผยท๋ง์ธ๋ ฅ ๊ณ์ฐ์ ์ํ TypeScript ์์ง์ ๋๋ค. ์๋ ์์ผ์ ์ ๋ ฅ์ ์์๋ ฅ, ์ค๋ฌ, ํ๊ตญ ๋ฒ์ ์, ์ ๊ธฐ ๊ฒฝ๊ณ, ์์ ๊ธฐ์ค, ์งํ์์ ๋ณด์ ์ ์ฑ ์ ๋ฐ๋ผ ์ ๊ทํํ๊ณ ์ฌ์ฃผํ์์ ๊ด๋ จ ์ด์ธ ๊ณ์ฐ ๊ฒฐ๊ณผ๋ฅผ ์ ๊ณตํฉ๋๋ค.
- ์๋ ฅ ์ ๋ ฅ๊ณผ ์๋ ฅ ์ ๋ ฅ ์ง์
- ์๋ ฅ ์ค๋ฌ ๋ณํ ์ง์
- ํ๊ตญ ๋ฒ์ ์ ์ ์ฑ
๋ฐ์
- UTC+08:30 ์๊ธฐ
- UTC+09:00 ์๊ธฐ
- 1948
1960, 19871988 ํ์ ๊ธฐ/DST - ์กด์ฌํ์ง ์๋ ๋ฏผ๊ฐ์๊ฐ๊ณผ ์ค๋ณต ๋ฏผ๊ฐ์๊ฐ ์ค๋ฅ ์ฒ๋ฆฌ
- ์งํ์์ ๋ณด์
- ๊ด์ธก์ง ๊ฒฝ๋
- ๊ธฐ์ค ์์ค์
- ๊ท ์์ฐจ
- 24์ ๊ธฐ ๋ฐ์ดํฐ์ ์ ์ ์๊ฐ ๊ธฐ๋ฐ ์์ฃผ ๊ณ์ฐ
- ์ฐ์ฃผ, ์์ฃผ, ์ผ์ฃผ, ์์ฃผ ๊ณ์ฐ
- ์ผ์์/์กฐ์์ ๊ธฐ์ค ์ ํ
- ์ง์ ๋ฒ์: ๊ณต๊ฐ ๊ณ์ฐ ๊ธฐ์ค 1908-04-01 ~ 2101๋ , ๋ด๋ถ ์ ๊ธฐ/์์๋ ฅ ์์ฒ ๋ฐ์ดํฐ 1899 ~ 2101๋
- ํ์ ์ฐ์ถ
- ๋์ด, ์ธ์ด, ์์ด ๊ณ์ฐ
- ๋์ด ์์ ๋์ด์ ์์ ๊ฐ์ ์ ๊ณ์ฐ
- ์ญ์ ๊ณ์ฐ
- ์ง์ฅ๊ฐ ์ญ์ ๊ณ์ฐ
- ์ด์ฑ ๊ณ์ฐ
- ์ ์ด ๊ณ์ฐ
- ์ง์ง ํฉยท์ถฉยทํยทํยทํด ๊ด๊ณ ๋ถ์
- ๊ณต๋ง ๊ณ์ฐ
- ๋ฉ์์คํ ๊ณ์ฐ
- ์์ง ๋ถ์
- ๊ฒฉ๊ตญ ํ๋จ
- ์ฉ์ ํ๋จ
- ๊ถํฉ
- ๋ฌ๋ ฅ
- ์๋ช
- ์๋ฏธ๋์
- ๊ธฐ๋ฌธ๋๊ฐ
- ํ ์ ๋น๊ฒฐ
- ๋์ก์
- ํ์ฐ
- ๋งคํ์ญ์
- ํ๋ฝ์ด์
- ๊ตฌ์ฑํ
- ๋์ ์
npm installnpm run type-check
npm run build
npm test
npm run solar-terms:verifytype BirthInputData = {
year: number;
month: number;
day: number;
hour: number | null;
minute: number | null;
gender: 'male' | 'female';
isLunar: boolean;
isLeapMonth?: boolean;
birthPlace: string | null;
};
type CalculateOptions = {
trueSolarTime?: boolean;
longitude?: number;
midnightMode?: 'yaja' | 'joja';
};import { calculatePalja } from 'manseryeok-engine';
const birth = {
year: 1990,
month: 3,
day: 15,
hour: 14,
minute: 30,
gender: 'male' as const,
isLunar: false,
birthPlace: 'Seoul',
};
const palja = calculatePalja(birth, {
trueSolarTime: true,
longitude: 126.978,
midnightMode: 'yaja',
});
console.log(palja);
// {
// yearGan: 'ๅบ',
// yearJi: 'ๅ',
// monthGan: 'ๅทฑ',
// monthJi: 'ๅฏ',
// dayGan: '...',
// dayJi: '...',
// hourGan: '...',
// hourJi: '...'
// }import { buildSajuResult } from 'manseryeok-engine';
const result = buildSajuResult(birth, {
calculateOptions: {
trueSolarTime: true,
longitude: 126.978,
midnightMode: 'yaja',
},
now: new Date('2026-07-07T00:00:00+09:00'),
subSchool: 'gyeokguk',
});
console.log(result.palja);
console.log(result.sipsin);
console.log(result.daeun);
console.log(result.seun);
console.log(result.wolun);
console.log(result.gyeokguk);
console.log(result.yongsin);import {
calculatePalja,
calculateDaeun,
calculateSeun,
calculateWolun,
calculateYunStartAge,
} from 'manseryeok-engine';
const palja = calculatePalja(birth);
const daeun = calculateDaeun(palja, birth, 8);
const yunStartAge = calculateYunStartAge(birth);
const seun = calculateSeun(2026);
const wolun = calculateWolun(new Date('2026-07-07T00:00:00+09:00'));
console.log({ daeun, yunStartAge, seun, wolun });import { ManseryeokEngine } from 'manseryeok-engine';
const lunar = ManseryeokEngine.solarToLunar({
year: 1990,
month: 3,
day: 15,
hour: 14,
minute: 30,
});
const solar = ManseryeokEngine.lunarToSolar({
year: 1990,
month: 2,
day: 19,
isLeapMonth: false,
hour: 14,
minute: 30,
});
const terms = ManseryeokEngine.listSolarTermsForYear(2026);
const context = ManseryeokEngine.getSolarContext({
year: 2026,
month: 2,
day: 4,
hour: 5,
minute: 0,
});
console.log({ lunar, solar, terms, context });import { createNormalizedManseryeokContext } from 'manseryeok-engine';
const context = createNormalizedManseryeokContext(birth, {
trueSolarTime: true,
longitude: 126.978,
midnightMode: 'yaja',
});
console.log(context.legalTime);
console.log(context.trueSolar);
console.log(context.yearMonthContextDateTime);
console.log(context.dayHourContextDateTime);ํ๊ตญ ๋ฒ์ ์ ์ ํ ๊ตฌ๊ฐ์์๋ ์ ๋ ฅ ์๊ฐ์ด ์กด์ฌํ์ง ์๊ฑฐ๋ ์ค๋ณต๋ ์ ์์ต๋๋ค. ์ด ๊ฒฝ์ฐ ๋ช ์์ ์ธ ์์ง ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
import {
createNormalizedManseryeokContext,
ManseryeokPolicyError,
NonexistentCivilTimeError,
AmbiguousCivilTimeError,
} from 'manseryeok-engine';
try {
createNormalizedManseryeokContext({
year: 1961,
month: 8,
day: 10,
hour: 0,
minute: 15,
gender: 'male',
isLunar: false,
birthPlace: null,
});
} catch (error) {
if (error instanceof NonexistentCivilTimeError) {
console.error('์กด์ฌํ์ง ์๋ ๋ฏผ๊ฐ์๊ฐ์
๋๋ค.', error.context);
} else if (error instanceof AmbiguousCivilTimeError) {
console.error('์ค๋ณต ๋ฏผ๊ฐ์๊ฐ์
๋๋ค.', error.context);
} else if (error instanceof ManseryeokPolicyError) {
console.error('๋ง์ธ๋ ฅ ์ ์ฑ
์ค๋ฅ์
๋๋ค.', error.context);
} else {
throw error;
}
}calculatePalja(input, options?)buildSajuResult(input, options?)calculateDaeun(palja, input, count?, options?)calculateYunStartAge(input, options?)calculateSeun(yearOrDate)calculateWolun(date)createNormalizedManseryeokContext(input, options?)ManseryeokEngine.solarToLunar(input)ManseryeokEngine.lunarToSolar(input)ManseryeokEngine.getGanji(input)ManseryeokEngine.getSolarContext(input)ManseryeokEngine.listSolarTermsForYear(year)
ISC