kor-lunar 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +6 -45
- package/dist/kor-lunar.d.ts +23 -8
- package/dist/kor-lunar.esm.js +86 -63
- package/dist/kor-lunar.esm.js.map +1 -1
- package/dist/kor-lunar.js +86 -63
- package/dist/kor-lunar.js.map +1 -1
- package/dist/kor-lunar.min.js +1 -1
- package/dist/lunar-data.d.ts +85 -25
- package/dist/solar-data.d.ts +25 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ const korLunar = require("kor-lunar");
|
|
|
40
40
|
### 브라우저 CDN
|
|
41
41
|
|
|
42
42
|
```html
|
|
43
|
-
<script src="https://cdn.jsdelivr.net/npm/kor-lunar@1.3.
|
|
43
|
+
<script src="https://cdn.jsdelivr.net/npm/kor-lunar@1.3.3/dist/kor-lunar.min.js"></script>
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
## 예제
|
package/dist/index.d.ts
CHANGED
|
@@ -1,48 +1,9 @@
|
|
|
1
|
-
import { toLunar, toSolar, LunarData, SolarData } from "./kor-lunar";
|
|
1
|
+
import { toLunar, toSolar, LunarData, SolarData, LunarDate, SolarDate } from "./kor-lunar";
|
|
2
2
|
declare const korLunar: {
|
|
3
|
-
toLunar: (solYear: number, solMonth: number, solDay: number) =>
|
|
4
|
-
toSolar: (lunYear: number, lunMonth: number, lunDay: number, isLeapMonth: boolean) =>
|
|
5
|
-
LunarData:
|
|
6
|
-
|
|
7
|
-
BASE_MONTH: number;
|
|
8
|
-
BASE_DAY: number;
|
|
9
|
-
BASE_VALUE: number;
|
|
10
|
-
MAX_YEAR: number;
|
|
11
|
-
MAX_MONTH: number;
|
|
12
|
-
MAX_DAY: number;
|
|
13
|
-
MAX_VALUE: number;
|
|
14
|
-
getMonthDays: (year: number, month: number) => number;
|
|
15
|
-
getLeapMonth: (year: number) => number;
|
|
16
|
-
hasLeapMonth: (year: number) => boolean;
|
|
17
|
-
isLeapMonth: (year: number, month: number) => boolean;
|
|
18
|
-
getLeapMonthDays: (year: number, month: number) => number;
|
|
19
|
-
getYearDays: (year: number) => number;
|
|
20
|
-
getTotalDaysBeforeYear: (year: number) => number;
|
|
21
|
-
getTotalDaysBeforeMonth: (year: number, month: number, isLeapMonth: boolean) => number;
|
|
22
|
-
getTotalDays: (year: number, month: number, day: number, isLeapMonth: boolean) => number;
|
|
23
|
-
getSecha: (year: number) => string;
|
|
24
|
-
getWolgeon: (year: number, month: number) => string;
|
|
25
|
-
getIljin: (year: number, month: number, day: number, isLeapMonth: boolean) => string;
|
|
26
|
-
getIljinByJulianDay: (julianDay: number) => string;
|
|
27
|
-
isDateInRange: (year: number, month: number, day: number) => boolean;
|
|
28
|
-
isValidDate: (year: number, month: number, day: number, isLeapMonth: boolean) => boolean;
|
|
29
|
-
};
|
|
30
|
-
SolarData: {
|
|
31
|
-
BASE_YEAR: number;
|
|
32
|
-
BASE_MONTH: number;
|
|
33
|
-
BASE_DAY: number;
|
|
34
|
-
BASE_VALUE: number;
|
|
35
|
-
MAX_YEAR: number;
|
|
36
|
-
MAX_MONTH: number;
|
|
37
|
-
MAX_DAY: number;
|
|
38
|
-
MAX_VALUE: number;
|
|
39
|
-
isLeapYear: (year: number) => boolean;
|
|
40
|
-
getMonthDays: (year: number, month: number) => number;
|
|
41
|
-
getYearDays: (year: number) => number;
|
|
42
|
-
getTotalDays: (year: number, month: number, day: number) => number;
|
|
43
|
-
isDateInRange: (year: number, month: number, day: number) => boolean;
|
|
44
|
-
isValidDate: (year: number, month: number, day: number) => boolean;
|
|
45
|
-
};
|
|
3
|
+
toLunar: (solYear: number, solMonth: number, solDay: number) => LunarDate;
|
|
4
|
+
toSolar: (lunYear: number, lunMonth: number, lunDay: number, isLeapMonth: boolean) => SolarDate;
|
|
5
|
+
LunarData: typeof LunarData;
|
|
6
|
+
SolarData: typeof SolarData;
|
|
46
7
|
};
|
|
47
8
|
export default korLunar;
|
|
48
|
-
export { toLunar, toSolar, LunarData, SolarData };
|
|
9
|
+
export { toLunar, toSolar, LunarData, SolarData, LunarDate, SolarDate };
|
package/dist/kor-lunar.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { SolarData } from "./solar-data";
|
|
3
|
-
interface LunarDate {
|
|
1
|
+
export interface LunarDate {
|
|
4
2
|
year: number;
|
|
5
3
|
month: number;
|
|
6
4
|
day: number;
|
|
@@ -11,12 +9,29 @@ interface LunarDate {
|
|
|
11
9
|
julianDay: number;
|
|
12
10
|
dayOfWeek: number;
|
|
13
11
|
}
|
|
14
|
-
interface SolarDate {
|
|
12
|
+
export interface SolarDate {
|
|
15
13
|
year: number;
|
|
16
14
|
month: number;
|
|
17
15
|
day: number;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
/**
|
|
18
|
+
* 양력을 음력으로 변환합니다.
|
|
19
|
+
* 양력 지원 날짜 범위: 1890년 1월 21일 ~ 2050년 1월 22일
|
|
20
|
+
* @param solYear 양력 연도
|
|
21
|
+
* @param solMonth 양력 월
|
|
22
|
+
* @param solDay 양력 일
|
|
23
|
+
* @returns 음력 날짜
|
|
24
|
+
*/
|
|
25
|
+
export declare const toLunar: (solYear: number, solMonth: number, solDay: number) => LunarDate;
|
|
26
|
+
/**
|
|
27
|
+
* 음력을 양력으로 변환합니다.
|
|
28
|
+
* 음력 지원 날짜 범위: 1890년 1월 1일 ~ 2049년 12월 29일
|
|
29
|
+
* @param lunYear 음력 연도
|
|
30
|
+
* @param lunMonth 음력 월
|
|
31
|
+
* @param lunDay 음력 일
|
|
32
|
+
* @param isLeapMonth 음력 윤달 여부, 윤달이면 true
|
|
33
|
+
* @returns 양력 날짜
|
|
34
|
+
*/
|
|
35
|
+
export declare const toSolar: (lunYear: number, lunMonth: number, lunDay: number, isLeapMonth: boolean) => SolarDate;
|
|
36
|
+
export * as LunarData from "./lunar-data";
|
|
37
|
+
export * as SolarData from "./solar-data";
|
package/dist/kor-lunar.esm.js
CHANGED
|
@@ -227,31 +227,33 @@ var isValidDate$1 = function (year, month, day, isLeapMonth) {
|
|
|
227
227
|
var endDay = isLeapMonth ? getLeapMonthDays(year, month) : getMonthDays$1(year, month);
|
|
228
228
|
return day <= endDay;
|
|
229
229
|
};
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
230
|
+
|
|
231
|
+
var LunarData = /*#__PURE__*/Object.freeze({
|
|
232
|
+
__proto__: null,
|
|
233
|
+
BASE_YEAR: BASE_YEAR$1,
|
|
234
|
+
BASE_MONTH: BASE_MONTH$1,
|
|
235
|
+
BASE_DAY: BASE_DAY$1,
|
|
236
|
+
BASE_VALUE: BASE_VALUE$1,
|
|
237
|
+
MAX_YEAR: MAX_YEAR$1,
|
|
238
|
+
MAX_MONTH: MAX_MONTH$1,
|
|
239
|
+
MAX_DAY: MAX_DAY$1,
|
|
240
|
+
MAX_VALUE: MAX_VALUE$1,
|
|
241
|
+
getMonthDays: getMonthDays$1,
|
|
242
|
+
getLeapMonth: getLeapMonth,
|
|
243
|
+
hasLeapMonth: hasLeapMonth,
|
|
244
|
+
isLeapMonth: isLeapMonth,
|
|
245
|
+
getLeapMonthDays: getLeapMonthDays,
|
|
246
|
+
getYearDays: getYearDays$1,
|
|
247
|
+
getTotalDaysBeforeYear: getTotalDaysBeforeYear$1,
|
|
248
|
+
getTotalDaysBeforeMonth: getTotalDaysBeforeMonth$1,
|
|
249
|
+
getTotalDays: getTotalDays$1,
|
|
250
|
+
getSecha: getSecha,
|
|
251
|
+
getWolgeon: getWolgeon,
|
|
252
|
+
getIljinByJulianDay: getIljinByJulianDay,
|
|
253
|
+
getIljin: getIljin,
|
|
254
|
+
isDateInRange: isDateInRange$1,
|
|
255
|
+
isValidDate: isValidDate$1
|
|
256
|
+
});
|
|
255
257
|
|
|
256
258
|
var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
257
259
|
var LEAP_FEBRUARY_DAY = 29;
|
|
@@ -344,52 +346,64 @@ var isValidDate = function (year, month, day) {
|
|
|
344
346
|
var endDay = getMonthDays(year, month);
|
|
345
347
|
return day <= endDay;
|
|
346
348
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
349
|
+
|
|
350
|
+
var SolarData = /*#__PURE__*/Object.freeze({
|
|
351
|
+
__proto__: null,
|
|
352
|
+
BASE_YEAR: BASE_YEAR,
|
|
353
|
+
BASE_MONTH: BASE_MONTH,
|
|
354
|
+
BASE_DAY: BASE_DAY,
|
|
355
|
+
BASE_VALUE: BASE_VALUE,
|
|
356
|
+
MAX_YEAR: MAX_YEAR,
|
|
357
|
+
MAX_MONTH: MAX_MONTH,
|
|
358
|
+
MAX_DAY: MAX_DAY,
|
|
359
|
+
MAX_VALUE: MAX_VALUE,
|
|
360
|
+
isLeapYear: isLeapYear,
|
|
361
|
+
getMonthDays: getMonthDays,
|
|
362
|
+
getYearDays: getYearDays,
|
|
363
|
+
getTotalDaysBeforeYear: getTotalDaysBeforeYear,
|
|
364
|
+
getTotalDaysBeforeMonth: getTotalDaysBeforeMonth,
|
|
365
|
+
getTotalDays: getTotalDays,
|
|
366
|
+
isDateInRange: isDateInRange,
|
|
367
|
+
isValidDate: isValidDate
|
|
368
|
+
});
|
|
363
369
|
|
|
364
370
|
var SOLAR_LUNAR_DAY_DIFF = 20;
|
|
365
371
|
var JULIAN_DAY_DIFF = 2411389;
|
|
372
|
+
/**
|
|
373
|
+
* 양력을 음력으로 변환합니다.
|
|
374
|
+
* 양력 지원 날짜 범위: 1890년 1월 21일 ~ 2050년 1월 22일
|
|
375
|
+
* @param solYear 양력 연도
|
|
376
|
+
* @param solMonth 양력 월
|
|
377
|
+
* @param solDay 양력 일
|
|
378
|
+
* @returns 음력 날짜
|
|
379
|
+
*/
|
|
366
380
|
var toLunar = function (solYear, solMonth, solDay) {
|
|
367
381
|
solYear = toInt(solYear);
|
|
368
382
|
solMonth = toInt(solMonth);
|
|
369
383
|
solDay = toInt(solDay);
|
|
370
|
-
if (!
|
|
384
|
+
if (!isDateInRange(solYear, solMonth, solDay)) {
|
|
371
385
|
throw new RangeError("\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uB0A0\uC9DC\uC785\uB2C8\uB2E4. \uC785\uB825\uD55C \uB0A0\uC9DC: ".concat(solYear, "-").concat(solMonth, "-").concat(solDay));
|
|
372
386
|
}
|
|
373
|
-
var year =
|
|
374
|
-
var month =
|
|
375
|
-
var day =
|
|
387
|
+
var year = BASE_YEAR$1;
|
|
388
|
+
var month = BASE_MONTH$1;
|
|
389
|
+
var day = BASE_DAY$1 + getTotalDays(solYear, solMonth, solDay) - SOLAR_LUNAR_DAY_DIFF - 1;
|
|
376
390
|
var julianDay = JULIAN_DAY_DIFF + day - 1;
|
|
377
391
|
var dayOfWeek = (day + 1) % 7;
|
|
378
|
-
var yearDays =
|
|
392
|
+
var yearDays = getYearDays$1(year);
|
|
379
393
|
while (day > yearDays) {
|
|
380
394
|
year++;
|
|
381
395
|
day -= yearDays;
|
|
382
|
-
yearDays =
|
|
396
|
+
yearDays = getYearDays$1(year);
|
|
383
397
|
}
|
|
384
398
|
var isLeapMonth = false;
|
|
385
|
-
var leapMonth =
|
|
386
|
-
var monthDays =
|
|
399
|
+
var leapMonth = getLeapMonth(year);
|
|
400
|
+
var monthDays = getMonthDays$1(year, month);
|
|
387
401
|
while (day > monthDays) {
|
|
388
402
|
day -= monthDays;
|
|
389
403
|
isLeapMonth = false;
|
|
390
404
|
if (month === leapMonth) {
|
|
391
405
|
leapMonth = 0;
|
|
392
|
-
monthDays =
|
|
406
|
+
monthDays = getLeapMonthDays(year, month);
|
|
393
407
|
isLeapMonth = true;
|
|
394
408
|
continue;
|
|
395
409
|
}
|
|
@@ -397,39 +411,48 @@ var toLunar = function (solYear, solMonth, solDay) {
|
|
|
397
411
|
if (month > 12) {
|
|
398
412
|
month = 1;
|
|
399
413
|
year++;
|
|
400
|
-
leapMonth =
|
|
414
|
+
leapMonth = getLeapMonth(year);
|
|
401
415
|
}
|
|
402
|
-
monthDays =
|
|
416
|
+
monthDays = getMonthDays$1(year, month);
|
|
403
417
|
}
|
|
404
418
|
return {
|
|
405
419
|
year: year,
|
|
406
420
|
month: month,
|
|
407
421
|
day: day,
|
|
408
422
|
isLeapMonth: isLeapMonth,
|
|
409
|
-
secha:
|
|
410
|
-
wolgeon: isLeapMonth ? "" :
|
|
411
|
-
iljin:
|
|
423
|
+
secha: getSecha(year),
|
|
424
|
+
wolgeon: isLeapMonth ? "" : getWolgeon(year, month),
|
|
425
|
+
iljin: getIljinByJulianDay(julianDay),
|
|
412
426
|
julianDay: julianDay,
|
|
413
427
|
dayOfWeek: dayOfWeek,
|
|
414
428
|
};
|
|
415
429
|
};
|
|
430
|
+
/**
|
|
431
|
+
* 음력을 양력으로 변환합니다.
|
|
432
|
+
* 음력 지원 날짜 범위: 1890년 1월 1일 ~ 2049년 12월 29일
|
|
433
|
+
* @param lunYear 음력 연도
|
|
434
|
+
* @param lunMonth 음력 월
|
|
435
|
+
* @param lunDay 음력 일
|
|
436
|
+
* @param isLeapMonth 음력 윤달 여부, 윤달이면 true
|
|
437
|
+
* @returns 양력 날짜
|
|
438
|
+
*/
|
|
416
439
|
var toSolar = function (lunYear, lunMonth, lunDay, isLeapMonth) {
|
|
417
440
|
lunYear = toInt(lunYear);
|
|
418
441
|
lunMonth = toInt(lunMonth);
|
|
419
442
|
lunDay = toInt(lunDay);
|
|
420
|
-
if (!
|
|
443
|
+
if (!isDateInRange$1(lunYear, lunMonth, lunDay)) {
|
|
421
444
|
throw new RangeError("\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uB0A0\uC9DC\uC785\uB2C8\uB2E4. \uC785\uB825\uD55C \uB0A0\uC9DC: ".concat(lunYear, "-").concat(lunMonth, "-").concat(lunDay));
|
|
422
445
|
}
|
|
423
|
-
var year =
|
|
424
|
-
var month =
|
|
425
|
-
var day =
|
|
426
|
-
var yearDays =
|
|
446
|
+
var year = BASE_YEAR;
|
|
447
|
+
var month = BASE_MONTH;
|
|
448
|
+
var day = BASE_DAY + getTotalDays$1(lunYear, lunMonth, lunDay, isLeapMonth) - 1;
|
|
449
|
+
var yearDays = getYearDays(year);
|
|
427
450
|
while (day > yearDays) {
|
|
428
451
|
day -= yearDays;
|
|
429
452
|
year++;
|
|
430
|
-
yearDays =
|
|
453
|
+
yearDays = getYearDays(year);
|
|
431
454
|
}
|
|
432
|
-
var monthDays =
|
|
455
|
+
var monthDays = getMonthDays(year, month);
|
|
433
456
|
while (day > monthDays) {
|
|
434
457
|
day -= monthDays;
|
|
435
458
|
month++;
|
|
@@ -437,7 +460,7 @@ var toSolar = function (lunYear, lunMonth, lunDay, isLeapMonth) {
|
|
|
437
460
|
month = 1;
|
|
438
461
|
year++;
|
|
439
462
|
}
|
|
440
|
-
monthDays =
|
|
463
|
+
monthDays = getMonthDays(year, month);
|
|
441
464
|
}
|
|
442
465
|
return { year: year, month: month, day: day };
|
|
443
466
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kor-lunar.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kor-lunar.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/kor-lunar.js
CHANGED
|
@@ -231,31 +231,33 @@ var isValidDate$1 = function (year, month, day, isLeapMonth) {
|
|
|
231
231
|
var endDay = isLeapMonth ? getLeapMonthDays(year, month) : getMonthDays$1(year, month);
|
|
232
232
|
return day <= endDay;
|
|
233
233
|
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
234
|
+
|
|
235
|
+
var LunarData = /*#__PURE__*/Object.freeze({
|
|
236
|
+
__proto__: null,
|
|
237
|
+
BASE_YEAR: BASE_YEAR$1,
|
|
238
|
+
BASE_MONTH: BASE_MONTH$1,
|
|
239
|
+
BASE_DAY: BASE_DAY$1,
|
|
240
|
+
BASE_VALUE: BASE_VALUE$1,
|
|
241
|
+
MAX_YEAR: MAX_YEAR$1,
|
|
242
|
+
MAX_MONTH: MAX_MONTH$1,
|
|
243
|
+
MAX_DAY: MAX_DAY$1,
|
|
244
|
+
MAX_VALUE: MAX_VALUE$1,
|
|
245
|
+
getMonthDays: getMonthDays$1,
|
|
246
|
+
getLeapMonth: getLeapMonth,
|
|
247
|
+
hasLeapMonth: hasLeapMonth,
|
|
248
|
+
isLeapMonth: isLeapMonth,
|
|
249
|
+
getLeapMonthDays: getLeapMonthDays,
|
|
250
|
+
getYearDays: getYearDays$1,
|
|
251
|
+
getTotalDaysBeforeYear: getTotalDaysBeforeYear$1,
|
|
252
|
+
getTotalDaysBeforeMonth: getTotalDaysBeforeMonth$1,
|
|
253
|
+
getTotalDays: getTotalDays$1,
|
|
254
|
+
getSecha: getSecha,
|
|
255
|
+
getWolgeon: getWolgeon,
|
|
256
|
+
getIljinByJulianDay: getIljinByJulianDay,
|
|
257
|
+
getIljin: getIljin,
|
|
258
|
+
isDateInRange: isDateInRange$1,
|
|
259
|
+
isValidDate: isValidDate$1
|
|
260
|
+
});
|
|
259
261
|
|
|
260
262
|
var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
261
263
|
var LEAP_FEBRUARY_DAY = 29;
|
|
@@ -348,52 +350,64 @@ var isValidDate = function (year, month, day) {
|
|
|
348
350
|
var endDay = getMonthDays(year, month);
|
|
349
351
|
return day <= endDay;
|
|
350
352
|
};
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
353
|
+
|
|
354
|
+
var SolarData = /*#__PURE__*/Object.freeze({
|
|
355
|
+
__proto__: null,
|
|
356
|
+
BASE_YEAR: BASE_YEAR,
|
|
357
|
+
BASE_MONTH: BASE_MONTH,
|
|
358
|
+
BASE_DAY: BASE_DAY,
|
|
359
|
+
BASE_VALUE: BASE_VALUE,
|
|
360
|
+
MAX_YEAR: MAX_YEAR,
|
|
361
|
+
MAX_MONTH: MAX_MONTH,
|
|
362
|
+
MAX_DAY: MAX_DAY,
|
|
363
|
+
MAX_VALUE: MAX_VALUE,
|
|
364
|
+
isLeapYear: isLeapYear,
|
|
365
|
+
getMonthDays: getMonthDays,
|
|
366
|
+
getYearDays: getYearDays,
|
|
367
|
+
getTotalDaysBeforeYear: getTotalDaysBeforeYear,
|
|
368
|
+
getTotalDaysBeforeMonth: getTotalDaysBeforeMonth,
|
|
369
|
+
getTotalDays: getTotalDays,
|
|
370
|
+
isDateInRange: isDateInRange,
|
|
371
|
+
isValidDate: isValidDate
|
|
372
|
+
});
|
|
367
373
|
|
|
368
374
|
var SOLAR_LUNAR_DAY_DIFF = 20;
|
|
369
375
|
var JULIAN_DAY_DIFF = 2411389;
|
|
376
|
+
/**
|
|
377
|
+
* 양력을 음력으로 변환합니다.
|
|
378
|
+
* 양력 지원 날짜 범위: 1890년 1월 21일 ~ 2050년 1월 22일
|
|
379
|
+
* @param solYear 양력 연도
|
|
380
|
+
* @param solMonth 양력 월
|
|
381
|
+
* @param solDay 양력 일
|
|
382
|
+
* @returns 음력 날짜
|
|
383
|
+
*/
|
|
370
384
|
var toLunar = function (solYear, solMonth, solDay) {
|
|
371
385
|
solYear = toInt(solYear);
|
|
372
386
|
solMonth = toInt(solMonth);
|
|
373
387
|
solDay = toInt(solDay);
|
|
374
|
-
if (!
|
|
388
|
+
if (!isDateInRange(solYear, solMonth, solDay)) {
|
|
375
389
|
throw new RangeError("\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uB0A0\uC9DC\uC785\uB2C8\uB2E4. \uC785\uB825\uD55C \uB0A0\uC9DC: ".concat(solYear, "-").concat(solMonth, "-").concat(solDay));
|
|
376
390
|
}
|
|
377
|
-
var year =
|
|
378
|
-
var month =
|
|
379
|
-
var day =
|
|
391
|
+
var year = BASE_YEAR$1;
|
|
392
|
+
var month = BASE_MONTH$1;
|
|
393
|
+
var day = BASE_DAY$1 + getTotalDays(solYear, solMonth, solDay) - SOLAR_LUNAR_DAY_DIFF - 1;
|
|
380
394
|
var julianDay = JULIAN_DAY_DIFF + day - 1;
|
|
381
395
|
var dayOfWeek = (day + 1) % 7;
|
|
382
|
-
var yearDays =
|
|
396
|
+
var yearDays = getYearDays$1(year);
|
|
383
397
|
while (day > yearDays) {
|
|
384
398
|
year++;
|
|
385
399
|
day -= yearDays;
|
|
386
|
-
yearDays =
|
|
400
|
+
yearDays = getYearDays$1(year);
|
|
387
401
|
}
|
|
388
402
|
var isLeapMonth = false;
|
|
389
|
-
var leapMonth =
|
|
390
|
-
var monthDays =
|
|
403
|
+
var leapMonth = getLeapMonth(year);
|
|
404
|
+
var monthDays = getMonthDays$1(year, month);
|
|
391
405
|
while (day > monthDays) {
|
|
392
406
|
day -= monthDays;
|
|
393
407
|
isLeapMonth = false;
|
|
394
408
|
if (month === leapMonth) {
|
|
395
409
|
leapMonth = 0;
|
|
396
|
-
monthDays =
|
|
410
|
+
monthDays = getLeapMonthDays(year, month);
|
|
397
411
|
isLeapMonth = true;
|
|
398
412
|
continue;
|
|
399
413
|
}
|
|
@@ -401,39 +415,48 @@ var toLunar = function (solYear, solMonth, solDay) {
|
|
|
401
415
|
if (month > 12) {
|
|
402
416
|
month = 1;
|
|
403
417
|
year++;
|
|
404
|
-
leapMonth =
|
|
418
|
+
leapMonth = getLeapMonth(year);
|
|
405
419
|
}
|
|
406
|
-
monthDays =
|
|
420
|
+
monthDays = getMonthDays$1(year, month);
|
|
407
421
|
}
|
|
408
422
|
return {
|
|
409
423
|
year: year,
|
|
410
424
|
month: month,
|
|
411
425
|
day: day,
|
|
412
426
|
isLeapMonth: isLeapMonth,
|
|
413
|
-
secha:
|
|
414
|
-
wolgeon: isLeapMonth ? "" :
|
|
415
|
-
iljin:
|
|
427
|
+
secha: getSecha(year),
|
|
428
|
+
wolgeon: isLeapMonth ? "" : getWolgeon(year, month),
|
|
429
|
+
iljin: getIljinByJulianDay(julianDay),
|
|
416
430
|
julianDay: julianDay,
|
|
417
431
|
dayOfWeek: dayOfWeek,
|
|
418
432
|
};
|
|
419
433
|
};
|
|
434
|
+
/**
|
|
435
|
+
* 음력을 양력으로 변환합니다.
|
|
436
|
+
* 음력 지원 날짜 범위: 1890년 1월 1일 ~ 2049년 12월 29일
|
|
437
|
+
* @param lunYear 음력 연도
|
|
438
|
+
* @param lunMonth 음력 월
|
|
439
|
+
* @param lunDay 음력 일
|
|
440
|
+
* @param isLeapMonth 음력 윤달 여부, 윤달이면 true
|
|
441
|
+
* @returns 양력 날짜
|
|
442
|
+
*/
|
|
420
443
|
var toSolar = function (lunYear, lunMonth, lunDay, isLeapMonth) {
|
|
421
444
|
lunYear = toInt(lunYear);
|
|
422
445
|
lunMonth = toInt(lunMonth);
|
|
423
446
|
lunDay = toInt(lunDay);
|
|
424
|
-
if (!
|
|
447
|
+
if (!isDateInRange$1(lunYear, lunMonth, lunDay)) {
|
|
425
448
|
throw new RangeError("\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uB0A0\uC9DC\uC785\uB2C8\uB2E4. \uC785\uB825\uD55C \uB0A0\uC9DC: ".concat(lunYear, "-").concat(lunMonth, "-").concat(lunDay));
|
|
426
449
|
}
|
|
427
|
-
var year =
|
|
428
|
-
var month =
|
|
429
|
-
var day =
|
|
430
|
-
var yearDays =
|
|
450
|
+
var year = BASE_YEAR;
|
|
451
|
+
var month = BASE_MONTH;
|
|
452
|
+
var day = BASE_DAY + getTotalDays$1(lunYear, lunMonth, lunDay, isLeapMonth) - 1;
|
|
453
|
+
var yearDays = getYearDays(year);
|
|
431
454
|
while (day > yearDays) {
|
|
432
455
|
day -= yearDays;
|
|
433
456
|
year++;
|
|
434
|
-
yearDays =
|
|
457
|
+
yearDays = getYearDays(year);
|
|
435
458
|
}
|
|
436
|
-
var monthDays =
|
|
459
|
+
var monthDays = getMonthDays(year, month);
|
|
437
460
|
while (day > monthDays) {
|
|
438
461
|
day -= monthDays;
|
|
439
462
|
month++;
|
|
@@ -441,7 +464,7 @@ var toSolar = function (lunYear, lunMonth, lunDay, isLeapMonth) {
|
|
|
441
464
|
month = 1;
|
|
442
465
|
year++;
|
|
443
466
|
}
|
|
444
|
-
monthDays =
|
|
467
|
+
monthDays = getMonthDays(year, month);
|
|
445
468
|
}
|
|
446
469
|
return { year: year, month: month, day: day };
|
|
447
470
|
};
|
package/dist/kor-lunar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kor-lunar.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kor-lunar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/kor-lunar.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var korLunar=function(
|
|
1
|
+
var korLunar=function(n){"use strict";var r=function(n){return"string"==typeof n||"number"==typeof n?~~n:n},t=[50342582,46534058,50360036,46403236,46402890,50222421,46533271,46400854,50345309,46533333,50367442,46401362,46534309,50223914,46401099,46533275,50416294,46400874,46533465,50342826,46401362,50359717,46402341,46402123,50354523,46533293,46400874,50341301,46533545,50363858,46402962,46402853,50355501,46401878,46400181,50481885,46401236,46534057,50343626,46403218,50226854,46400807,46533207,50420054,46533338,46401236,50411345,46401353,50428691,46402195,46400811,50423067,46532973,46533482,50417060,46402468,46402377,50343243,46402197,50363051,46400813,46533293,50420394,46534066,46402980,50413217,46402890,50367893,46402198,46400854,50357621,46533333,46401234,50349909,46534309,46403146,50214478,46533275,50363094,46400874,46533465,50355122,46401362,46401317,50350891,46402123,50366891,46400173,46531947,50423209,46534057,46402962,50351509,46402853,50376269,46402134,46400182,50490093,46401236,46534057,50355922,46403218,46402854,50214190,46533207,50366902,46533466,46401236,50354025,46401353,46401171,50350743,46400811,46533211,50342574,46400362,50494933,46402468,46402377,50355539,46402197,46400813,50410797,46533293,50371498,46400978,46534053,50355882,46402890,46402197,50350749,46400854,46533301,50342614,46401234,50358117,46534309,46403146,50222678,46533787,46400858,50345325,46533481,50380626,46401362,46402341,50424587,46402123,46400683,50352827,46531949,46533481,50343338,46402962,50364069,46402853,46402125,50420301,46400182,46532021],e=["갑","을","병","정","무","기","경","신","임","계"],a=["자","축","인","묘","진","사","오","미","신","유","술","해"],o=1890,u=18900101,f=2049,i=20491229,c={},l=function(n){return n=r(n),t[n-o]},g=function(n,t){return t=r(t),0===(l(n)>>t-1&1)?29:30},A=function(n){return l(n)>>12&15},_=function(n,t){return(t=r(t))===A(n)},D=function(n,r){return _(n,r)?0===(l(n)>>16&1)?29:30:0},s=function(n){return l(n)>>17&511};c[1890]=0;for(var h=1891;h<=f;h++)c[h]=c[h-1]+s(h-1);var y=function(n){return n=r(n),c[n]},M=function(n,t,e){t=r(t);for(var a=0,o=1;o<t;o++)a+=g(n,o),o===A(n)&&(a+=D(n,o));var u=A(n);return e&&u===t&&(a+=g(n,t)),a},E=function(n,t,e,a){return e=r(e),y(n)+M(n,t,a)+e},v=function(n){return n=r(n),e[(n+6)%e.length]+a[(n+8)%a.length]},L=function(n,t){return n=r(n),t=r(t),e[(2*n+t+3)%e.length]+a[(t+1)%a.length]},B=function(n){return n=r(n),e[(n-1)%e.length]+a[(n+1)%a.length]},S=function(n,t,e){var a=1e4*(n=r(n))+100*(t=r(t))+(e=r(e));return a>=u&&a<=i},Y=Object.freeze({__proto__:null,BASE_YEAR:o,BASE_MONTH:1,BASE_DAY:1,BASE_VALUE:u,MAX_YEAR:f,MAX_MONTH:12,MAX_DAY:29,MAX_VALUE:i,getMonthDays:g,getLeapMonth:A,hasLeapMonth:function(n){return 0!==A(n)},isLeapMonth:_,getLeapMonthDays:D,getYearDays:s,getTotalDaysBeforeYear:y,getTotalDaysBeforeMonth:M,getTotalDays:E,getSecha:v,getWolgeon:L,getIljinByJulianDay:B,getIljin:function(n,r,t,e){var a=E(n,r,t,e);return B(a-1)},isDateInRange:S,isValidDate:function(n,t,e,a){if(n=r(n),t=r(t),e=r(e),n<o||n>f)return!1;if(n===o){if(t<1)return!1;if(1===t&&e<1)return!1}if(n===f){if(t>12)return!1;if(12===t&&e>29)return!1}return!(t<1||t>12)&&(!(e<1)&&e<=(a?D(n,t):g(n,t)))}}),p=[31,28,31,30,31,30,31,31,30,31,30,31],T=1890,d=18900121,O=2050,R=20500122,X={},j=function(n){return(n=r(n))%4==0&&n%100!=0||n%400==0},V=function(n,t){return 2===(t=r(t))&&j(n)?29:p[t-1]},w=function(n){return j(n)?366:365};X[1890]=0;for(var b=1891;b<=O;b++)X[b]=X[b-1]+w(b-1);var H=function(n){return n=r(n),X[n]},I=function(n,r){for(var t=0,e=1;e<r;e++)t+=V(n,e);return t},N=function(n,r,t){return H(n)+I(n,r)+t},U=function(n,t,e){var a=1e4*(n=r(n))+100*(t=r(t))+(e=r(e));return a>=d&&a<=R},m=Object.freeze({__proto__:null,BASE_YEAR:T,BASE_MONTH:1,BASE_DAY:21,BASE_VALUE:d,MAX_YEAR:O,MAX_MONTH:1,MAX_DAY:22,MAX_VALUE:R,isLeapYear:j,getMonthDays:V,getYearDays:w,getTotalDaysBeforeYear:H,getTotalDaysBeforeMonth:I,getTotalDays:N,isDateInRange:U,isValidDate:function(n,t,e){if(n=r(n),t=r(t),e=r(e),n<T||n>O)return!1;if(n===T){if(t<1)return!1;if(1===t&&e<21)return!1}if(n===O){if(t>1)return!1;if(1===t&&e>22)return!1}return!(t<1||t>12)&&(!(e<1)&&e<=V(n,t))}}),k=function(n,t,e){if(n=r(n),t=r(t),e=r(e),!U(n,t,e))throw new RangeError("지원되지 않는 날짜입니다. 입력한 날짜: ".concat(n,"-").concat(t,"-").concat(e));for(var a=o,u=1,f=1+N(n,t,e)-20-1,i=2411389+f-1,c=(f+1)%7,l=s(a);f>l;)a++,f-=l,l=s(a);for(var _=!1,h=A(a),y=g(a,u);f>y;)f-=y,_=!1,u!==h?(++u>12&&(u=1,a++,h=A(a)),y=g(a,u)):(h=0,y=D(a,u),_=!0);return{year:a,month:u,day:f,isLeapMonth:_,secha:v(a),wolgeon:_?"":L(a,u),iljin:B(i),julianDay:i,dayOfWeek:c}},z=function(n,t,e,a){if(n=r(n),t=r(t),e=r(e),!S(n,t,e))throw new RangeError("지원되지 않는 날짜입니다. 입력한 날짜: ".concat(n,"-").concat(t,"-").concat(e));for(var o=T,u=1,f=21+E(n,t,e,a)-1,i=w(o);f>i;)f-=i,o++,i=w(o);for(var c=V(o,u);f>c;)f-=c,++u>12&&(u=1,o++),c=V(o,u);return{year:o,month:u,day:f}},W={toLunar:k,toSolar:z,LunarData:Y,SolarData:m};return n.LunarData=Y,n.SolarData=m,n.default=W,n.toLunar=k,n.toSolar=z,Object.defineProperty(n,"__esModule",{value:!0}),n}({});
|
|
2
2
|
//# sourceMappingURL=kor-lunar.min.js.map
|
package/dist/lunar-data.d.ts
CHANGED
|
@@ -1,25 +1,85 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
export declare const BASE_YEAR = 1890;
|
|
2
|
+
export declare const BASE_MONTH = 1;
|
|
3
|
+
export declare const BASE_DAY = 1;
|
|
4
|
+
export declare const BASE_VALUE: number;
|
|
5
|
+
export declare const MAX_YEAR = 2049;
|
|
6
|
+
export declare const MAX_MONTH = 12;
|
|
7
|
+
export declare const MAX_DAY = 29;
|
|
8
|
+
export declare const MAX_VALUE: number;
|
|
9
|
+
/**
|
|
10
|
+
* 해당 월 (평달)의 일 수를 반환합니다.
|
|
11
|
+
* @param year 1890년 ~ 2049년
|
|
12
|
+
* @param month 1월 ~ 12월
|
|
13
|
+
* @returns 월의 일 수 (29 또는 30)
|
|
14
|
+
*/
|
|
15
|
+
export declare const getMonthDays: (year: number, month: number) => number;
|
|
16
|
+
/**
|
|
17
|
+
* 해당 연도의 윤달을 반환합니다.
|
|
18
|
+
* @param year 1890년 ~ 2049년
|
|
19
|
+
* @returns 윤달 월 (1월 ~ 12월), 없으면 0
|
|
20
|
+
*/
|
|
21
|
+
export declare const getLeapMonth: (year: number) => number;
|
|
22
|
+
/**
|
|
23
|
+
* 해당 연도에 윤달이 있는지를 반환합니다.
|
|
24
|
+
* @param year 1890년 ~ 2049년
|
|
25
|
+
* @return 윤달이 있으면 true
|
|
26
|
+
*/
|
|
27
|
+
export declare const hasLeapMonth: (year: number) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 해당 월이 윤달인지를 반환합니다.
|
|
30
|
+
* @param year 1890년 ~ 2049년
|
|
31
|
+
* @param month 1월 ~ 12월
|
|
32
|
+
* @returns 윤달이면 true
|
|
33
|
+
*/
|
|
34
|
+
export declare const isLeapMonth: (year: number, month: number) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 해당 월 (윤달)의 일 수를 반환합니다.
|
|
37
|
+
* @param year 1890년 ~ 2049년
|
|
38
|
+
* @param month 1월 ~ 12월
|
|
39
|
+
* @returns 윤달의 일 수 (29 또는 30), 윤달이 아니면 0
|
|
40
|
+
*/
|
|
41
|
+
export declare const getLeapMonthDays: (year: number, month: number) => number;
|
|
42
|
+
/**
|
|
43
|
+
* 해당 연도의 총 일 수를 반환합니다.
|
|
44
|
+
* @param year 1890년 ~ 2049년
|
|
45
|
+
* @return 해당 연도의 총 일 수
|
|
46
|
+
*/
|
|
47
|
+
export declare const getYearDays: (year: number) => number;
|
|
48
|
+
/**
|
|
49
|
+
* 1890년부터 해당 연도 전까지의 누적 일 수를 반환합니다.
|
|
50
|
+
* @param year 1890년 ~ 2049년
|
|
51
|
+
* @return 해당 연도 전까지의 누적 일 수
|
|
52
|
+
*/
|
|
53
|
+
export declare const getTotalDaysBeforeYear: (year: number) => number;
|
|
54
|
+
/**
|
|
55
|
+
* 해당 연도 내에서 해당 월 (및 윤달 포함) 전까지의 누적 일 수를 반환합니다.
|
|
56
|
+
* @param year 1890년 ~ 2049년
|
|
57
|
+
* @param month 1월 ~ 12월
|
|
58
|
+
* @param isLeapMonth 대상이 윤달이면 true
|
|
59
|
+
* @returns 해당 연도 내, 해당 월 전까지의 누적 일 수
|
|
60
|
+
*/
|
|
61
|
+
export declare const getTotalDaysBeforeMonth: (year: number, month: number, isLeapMonth: boolean) => number;
|
|
62
|
+
/**
|
|
63
|
+
* 1890년부터 해당 연도, 월, 일 (및 윤달 포함) 까지의 누적 일 수를 반환합니다.
|
|
64
|
+
* @param year 1890년 ~ 2049년
|
|
65
|
+
* @param month 1월 ~ 12월
|
|
66
|
+
* @param day 일자
|
|
67
|
+
* @param isLeapMonth 대상이 윤달이면 true
|
|
68
|
+
* @returns 총 누적 일 수
|
|
69
|
+
*/
|
|
70
|
+
export declare const getTotalDays: (year: number, month: number, day: number, isLeapMonth: boolean) => number;
|
|
71
|
+
export declare const getSecha: (year: number) => string;
|
|
72
|
+
export declare const getWolgeon: (year: number, month: number) => string;
|
|
73
|
+
export declare const getIljinByJulianDay: (julianDay: number) => string;
|
|
74
|
+
export declare const getIljin: (year: number, month: number, day: number, isLeapMonth: boolean) => string;
|
|
75
|
+
/**
|
|
76
|
+
* 날짜가 지원하는 범위 내에 있는지를 반환합니다.
|
|
77
|
+
* 날짜의 유효성 (존재 여부)은 검사하지 않습니다.
|
|
78
|
+
* @returns 날짜가 범위 내에 있으면 true
|
|
79
|
+
*/
|
|
80
|
+
export declare const isDateInRange: (year: number, month: number, day: number) => boolean;
|
|
81
|
+
/**
|
|
82
|
+
* 실제로 존재하는 유효한 날짜인지를 반환합니다.
|
|
83
|
+
* @returns 유효한 날짜이면 true
|
|
84
|
+
*/
|
|
85
|
+
export declare const isValidDate: (year: number, month: number, day: number, isLeapMonth: boolean) => boolean;
|
package/dist/solar-data.d.ts
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
export declare const BASE_YEAR = 1890;
|
|
2
|
+
export declare const BASE_MONTH = 1;
|
|
3
|
+
export declare const BASE_DAY = 21;
|
|
4
|
+
export declare const BASE_VALUE: number;
|
|
5
|
+
export declare const MAX_YEAR = 2050;
|
|
6
|
+
export declare const MAX_MONTH = 1;
|
|
7
|
+
export declare const MAX_DAY = 22;
|
|
8
|
+
export declare const MAX_VALUE: number;
|
|
9
|
+
export declare const isLeapYear: (year: number) => boolean;
|
|
10
|
+
export declare const getMonthDays: (year: number, month: number) => number;
|
|
11
|
+
export declare const getYearDays: (year: number) => number;
|
|
12
|
+
export declare const getTotalDaysBeforeYear: (year: number) => number;
|
|
13
|
+
export declare const getTotalDaysBeforeMonth: (year: number, month: number) => number;
|
|
14
|
+
export declare const getTotalDays: (year: number, month: number, day: number) => number;
|
|
15
|
+
/**
|
|
16
|
+
* 날짜가 지원하는 범위 내에 있는지를 반환합니다.
|
|
17
|
+
* 날짜의 유효성 (존재 여부)은 검사하지 않습니다.
|
|
18
|
+
* @returns 날짜가 범위 내에 있으면 true
|
|
19
|
+
*/
|
|
20
|
+
export declare const isDateInRange: (year: number, month: number, day: number) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 실제로 존재하는 유효한 날짜인지를 반환합니다.
|
|
23
|
+
* @returns 유효한 날짜이면 true
|
|
24
|
+
*/
|
|
25
|
+
export declare const isValidDate: (year: number, month: number, day: number) => boolean;
|