@ajf/calendars 13.0.0-next.9 → 13.0.0
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/esm2020/ethiopian/calendar-module.mjs +8 -16
- package/esm2020/ethiopian/calendar-service.mjs +7 -7
- package/esm2020/ethiopian/converter.mjs +34 -20
- package/esm2020/ethiopian/ethiopian-date-pipe.mjs +6 -6
- package/esm2020/ethiopian/ethiopian-date.mjs +26 -10
- package/esm2020/ethiopian/ethiopian_public_index.mjs +5 -0
- package/esm2020/ethiopian/index.mjs +20 -2
- package/esm2020/ethiopian/utils.mjs +29 -3
- package/esm2020/version.mjs +1 -1
- package/ethiopian/converter.d.ts +1 -5
- package/ethiopian/ethiopian-date.d.ts +11 -1
- package/ethiopian/ethiopian_public_index.d.ts +4 -0
- package/ethiopian/index.d.ts +19 -1
- package/ethiopian/package.json +2 -2
- package/fesm2015/calendars.mjs +1 -1
- package/fesm2015/calendars.mjs.map +1 -1
- package/fesm2015/ethiopian.mjs +124 -54
- package/fesm2015/ethiopian.mjs.map +1 -1
- package/fesm2020/calendars.mjs +1 -1
- package/fesm2020/calendars.mjs.map +1 -1
- package/fesm2020/ethiopian.mjs +124 -54
- package/fesm2020/ethiopian.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -21,7 +21,33 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export const WEEK_NAMES = ['እሑድ', 'ሰኞ', 'ማክሰኞ', 'ረቡዕ', 'ሓሙስ', 'ዓርብ', 'ቅዳሜ'];
|
|
23
23
|
export const MONTHS_NAMES = [
|
|
24
|
-
'መስከረም',
|
|
24
|
+
'መስከረም',
|
|
25
|
+
'ጥቅምት',
|
|
26
|
+
'ኅዳር',
|
|
27
|
+
'ታኅሣሥ',
|
|
28
|
+
'ጥር',
|
|
29
|
+
'የካቲት',
|
|
30
|
+
'መጋቢት',
|
|
31
|
+
'ሚያዝያ',
|
|
32
|
+
'ግንቦት',
|
|
33
|
+
'ሰኔ',
|
|
34
|
+
'ሐምሌ',
|
|
35
|
+
'ነሐሴ',
|
|
36
|
+
'ጳጉሜን',
|
|
25
37
|
];
|
|
26
|
-
export const SHORT_MONTHS_NAMES = [
|
|
27
|
-
|
|
38
|
+
export const SHORT_MONTHS_NAMES = [
|
|
39
|
+
'መስከ',
|
|
40
|
+
'ጥቅም',
|
|
41
|
+
'ኅዳር',
|
|
42
|
+
'ታኅሣ',
|
|
43
|
+
'ጥር',
|
|
44
|
+
'የካቲ',
|
|
45
|
+
'መጋቢ',
|
|
46
|
+
'ሚያዝ',
|
|
47
|
+
'ግንቦ',
|
|
48
|
+
'ሰኔ',
|
|
49
|
+
'ሐምሌ',
|
|
50
|
+
'ነሐሴ',
|
|
51
|
+
'ጳጉሜ',
|
|
52
|
+
];
|
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvY2FsZW5kYXJzL2V0aGlvcGlhbi91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FvQkc7QUFFSCxNQUFNLENBQUMsTUFBTSxVQUFVLEdBQUcsQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRSxLQUFLLENBQUMsQ0FBQztBQUU1RSxNQUFNLENBQUMsTUFBTSxZQUFZLEdBQUc7SUFDMUIsT0FBTztJQUNQLE1BQU07SUFDTixLQUFLO0lBQ0wsTUFBTTtJQUNOLElBQUk7SUFDSixNQUFNO0lBQ04sTUFBTTtJQUNOLE1BQU07SUFDTixNQUFNO0lBQ04sSUFBSTtJQUNKLEtBQUs7SUFDTCxLQUFLO0lBQ0wsTUFBTTtDQUNQLENBQUM7QU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JpicsXG4gICfhiLDhipQnLFxuICAn4YiQ4Yid4YiMJyxcbiAgJ+GKkOGIkOGItCcsXG4gICfhjLPhjInhiJwnLFxuXTtcbiJdfQ==
|
package/esm2020/version.mjs
CHANGED
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { Version } from '@angular/core';
|
|
23
23
|
/** Current version of Ajf. */
|
|
24
|
-
export const VERSION = new Version('13.0.0
|
|
24
|
+
export const VERSION = new Version('13.0.0');
|
|
25
25
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jYWxlbmRhcnMvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FvQkc7QUFFSCxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRXRDLDhCQUE4QjtBQUM5QixNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsSUFBSSxPQUFPLENBQUMsbUJBQW1CLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAoQykgR251Y29vcCBzb2MuIGNvb3AuXG4gKlxuICogVGhpcyBmaWxlIGlzIHBhcnQgb2YgdGhlIEFkdmFuY2VkIEpTT04gZm9ybXMgKGFqZikuXG4gKlxuICogQWR2YW5jZWQgSlNPTiBmb3JtcyAoYWpmKSBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3JcbiAqIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBBZmZlcm8gR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhc1xuICogcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIGVpdGhlciB2ZXJzaW9uIDMgb2YgdGhlIExpY2Vuc2UsXG4gKiBvciAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLlxuICpcbiAqIEFkdmFuY2VkIEpTT04gZm9ybXMgKGFqZikgaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCxcbiAqIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mXG4gKiBNRVJDSEFOVEFCSUxJVFkgb3IgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuIFNlZSB0aGUgR05VIEFmZmVyb1xuICogR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLlxuICpcbiAqIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBBZmZlcm8gR2VuZXJhbCBQdWJsaWMgTGljZW5zZVxuICogYWxvbmcgd2l0aCBBZHZhbmNlZCBKU09OIGZvcm1zIChhamYpLlxuICogSWYgbm90LCBzZWUgaHR0cDovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLy5cbiAqXG4gKi9cblxuaW1wb3J0IHtWZXJzaW9ufSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuLyoqIEN1cnJlbnQgdmVyc2lvbiBvZiBBamYuICovXG5leHBvcnQgY29uc3QgVkVSU0lPTiA9IG5ldyBWZXJzaW9uKCcwLjAuMC1QTEFDRUhPTERFUicpO1xuIl19
|
package/ethiopian/converter.d.ts
CHANGED
|
@@ -21,10 +21,6 @@
|
|
|
21
21
|
*/
|
|
22
22
|
/** API * */
|
|
23
23
|
/** ethiopian to gregorian */
|
|
24
|
-
export declare function toGC(dateArray: [number, number, number] | [number, number, number, number]): [
|
|
25
|
-
number,
|
|
26
|
-
number,
|
|
27
|
-
number
|
|
28
|
-
];
|
|
24
|
+
export declare function toGC(dateArray: [number, number, number] | [number, number, number, number]): [number, number, number];
|
|
29
25
|
/** gregorian to ethiopian */
|
|
30
26
|
export declare function toEC(dateArray: [number, number, number]): [number, number, number];
|
|
@@ -51,12 +51,22 @@ export declare class EthiopianDate {
|
|
|
51
51
|
* @param val - A numeric year value if the second and third parameters are
|
|
52
52
|
* provided, it should be a date string if not
|
|
53
53
|
* @param month A zero-based numeric value for the month
|
|
54
|
-
* (0 for
|
|
54
|
+
* (0 for መስከረም, 12 for ጳጉሜን)
|
|
55
55
|
* @param day A numeric value equal for the day of the month.
|
|
56
56
|
*
|
|
57
57
|
* @api public
|
|
58
58
|
*/
|
|
59
59
|
static ethiopianToGregorian(val?: EthiopianDate | string | number, month?: number, day?: number): Date;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param val - A numeric year value if the second and third parameters are
|
|
63
|
+
* provided, it should be a date string if not
|
|
64
|
+
* @param month A zero-based numeric value for the month
|
|
65
|
+
* (0 for January, 11 for December)
|
|
66
|
+
* @param day A numeric value equal for the day of the month.
|
|
67
|
+
*
|
|
68
|
+
* @api public
|
|
69
|
+
*/
|
|
60
70
|
static gregorianToEthiopian(val?: Date | string | number, month?: number, day?: number): EthiopianDate;
|
|
61
71
|
/**
|
|
62
72
|
* Parse Ethiopian date from string
|
package/ethiopian/index.d.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (C) Gnucoop soc. coop.
|
|
4
|
+
*
|
|
5
|
+
* This file is part of the Advanced JSON forms (ajf).
|
|
6
|
+
*
|
|
7
|
+
* Advanced JSON forms (ajf) is free software: you can redistribute it and/or
|
|
8
|
+
* modify it under the terms of the GNU Affero General Public License as
|
|
9
|
+
* published by the Free Software Foundation, either version 3 of the License,
|
|
10
|
+
* or (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
|
|
15
|
+
* General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
18
|
+
* along with Advanced JSON forms (ajf).
|
|
19
|
+
* If not, see http://www.gnu.org/licenses/.
|
|
20
|
+
*
|
|
3
21
|
*/
|
|
4
22
|
export * from './public-api';
|
package/ethiopian/package.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"name": "@ajf/calendars/ethiopian",
|
|
3
3
|
"fesm2020": "../fesm2020/ethiopian.mjs",
|
|
4
4
|
"fesm2015": "../fesm2015/ethiopian.mjs",
|
|
5
|
-
"esm2020": "../esm2020/ethiopian/
|
|
6
|
-
"typings": "./
|
|
5
|
+
"esm2020": "../esm2020/ethiopian/ethiopian_public_index.mjs",
|
|
6
|
+
"typings": "./ethiopian_public_index.d.ts",
|
|
7
7
|
"module": "../fesm2015/ethiopian.mjs",
|
|
8
8
|
"es2020": "../fesm2020/ethiopian.mjs"
|
|
9
9
|
}
|
package/fesm2015/calendars.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendars.mjs","sources":["../../../../../../src/calendars/version.ts","../../../../../../src/calendars/public-api.ts","../../../../../../src/calendars/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of Ajf. */\nexport const VERSION = new Version('13.0.0
|
|
1
|
+
{"version":3,"file":"calendars.mjs","sources":["../../../../../../src/calendars/version.ts","../../../../../../src/calendars/public-api.ts","../../../../../../src/calendars/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of Ajf. */\nexport const VERSION = new Version('13.0.0');\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport * from './version';\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;AAwBA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;ACzBtD;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/fesm2015/ethiopian.mjs
CHANGED
|
@@ -35,14 +35,14 @@ function quotient(i, j) {
|
|
|
35
35
|
return Math.floor(i / j);
|
|
36
36
|
}
|
|
37
37
|
function isGregorianLeap(year) {
|
|
38
|
-
return
|
|
38
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
39
39
|
}
|
|
40
40
|
function setEra(era) {
|
|
41
|
-
if (
|
|
41
|
+
if (era === JD_EPOCH_OFFSET_AMETE_ALEM || era === JD_EPOCH_OFFSET_AMETE_MIHRET) {
|
|
42
42
|
JDN_OFFSET = era;
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
|
-
throw
|
|
45
|
+
throw new Error(`Unknown Era: ${era}`);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
function isEraSet() {
|
|
@@ -52,31 +52,42 @@ function unsetEra() {
|
|
|
52
52
|
JDN_OFFSET = JD_EPOCH_OFFSET_UNSET;
|
|
53
53
|
}
|
|
54
54
|
function guessEraFromJDN(jdn) {
|
|
55
|
-
return
|
|
56
|
-
|
|
55
|
+
return jdn >= JD_EPOCH_OFFSET_AMETE_MIHRET + 365
|
|
56
|
+
? JD_EPOCH_OFFSET_AMETE_MIHRET
|
|
57
|
+
: JD_EPOCH_OFFSET_AMETE_ALEM;
|
|
57
58
|
}
|
|
58
59
|
function ethiopicToJDN(day, month, year) {
|
|
59
60
|
const ERA = isEraSet() ? JDN_OFFSET : JD_EPOCH_OFFSET_AMETE_MIHRET;
|
|
60
|
-
const jdn =
|
|
61
|
+
const jdn = ERA + 365 + 365 * (year - 1) + quotient(year, 4) + 30 * month + day - 31;
|
|
61
62
|
return jdn;
|
|
62
63
|
}
|
|
63
64
|
function jdnToEthiopic(jdn) {
|
|
64
65
|
const ERA = isEraSet() ? JDN_OFFSET : guessEraFromJDN(jdn);
|
|
65
66
|
const r = (jdn - ERA) % 1461;
|
|
66
67
|
const n = (r % 365) + 365 * quotient(r, 1460);
|
|
67
|
-
const year = 4 * quotient(
|
|
68
|
+
const year = 4 * quotient(jdn - ERA, 1461) + quotient(r, 365) - quotient(r, 1460);
|
|
68
69
|
const month = quotient(n, 30) + 1;
|
|
69
70
|
const day = (n % 30) + 1;
|
|
70
71
|
return [year, month, day];
|
|
71
72
|
}
|
|
72
73
|
function gregorianToJDN(day, month, year) {
|
|
73
|
-
const s = quotient(year, 4) -
|
|
74
|
-
quotient(year - 1,
|
|
74
|
+
const s = quotient(year, 4) -
|
|
75
|
+
quotient(year - 1, 4) -
|
|
76
|
+
quotient(year, 100) +
|
|
77
|
+
quotient(year - 1, 100) +
|
|
78
|
+
quotient(year, 400) -
|
|
79
|
+
quotient(year - 1, 400);
|
|
75
80
|
const t = quotient(14 - month, 12);
|
|
76
81
|
const n = 31 * t * (month - 1) +
|
|
77
|
-
(1 - t) * (59 + s + 30 * (month - 3) + quotient(
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
(1 - t) * (59 + s + 30 * (month - 3) + quotient(3 * month - 7, 5)) +
|
|
83
|
+
day -
|
|
84
|
+
1;
|
|
85
|
+
const j = JD_EPOCH_OFFSET_GREGORIAN +
|
|
86
|
+
365 * (year - 1) +
|
|
87
|
+
quotient(year - 1, 4) -
|
|
88
|
+
quotient(year - 1, 100) +
|
|
89
|
+
quotient(year - 1, 400) +
|
|
90
|
+
n;
|
|
80
91
|
return j;
|
|
81
92
|
}
|
|
82
93
|
function jdnToGregorian(jdn) {
|
|
@@ -86,20 +97,23 @@ function jdnToGregorian(jdn) {
|
|
|
86
97
|
const r4 = r100 % 1461;
|
|
87
98
|
let n = (r4 % 365) + 365 * quotient(r4, 1460);
|
|
88
99
|
const s = quotient(r4, 1095);
|
|
89
|
-
const aprime = 400 * quotient(
|
|
90
|
-
100 * quotient(r400, 36524) +
|
|
91
|
-
|
|
100
|
+
const aprime = 400 * quotient(jdn - JD_EPOCH_OFFSET_GREGORIAN, 146097) +
|
|
101
|
+
100 * quotient(r400, 36524) +
|
|
102
|
+
4 * quotient(r100, 1461) +
|
|
103
|
+
quotient(r4, 365) -
|
|
104
|
+
quotient(r4, 1460) -
|
|
105
|
+
quotient(r2000, 730484);
|
|
92
106
|
const year = aprime + 1;
|
|
93
|
-
const t = quotient(
|
|
94
|
-
let month = t * (quotient(n, 31) + 1) + (1 - t) * (quotient(
|
|
107
|
+
const t = quotient(364 + s - n, 306);
|
|
108
|
+
let month = t * (quotient(n, 31) + 1) + (1 - t) * (quotient(5 * (n - s) + 13, 153) + 1);
|
|
95
109
|
n += 1 - quotient(r2000, 730484);
|
|
96
110
|
let day = n;
|
|
97
|
-
if (
|
|
111
|
+
if (r100 === 0 && n === 0 && r400 !== 0) {
|
|
98
112
|
month = 12;
|
|
99
113
|
day = 31;
|
|
100
114
|
}
|
|
101
115
|
else {
|
|
102
|
-
monthDays[2] =
|
|
116
|
+
monthDays[2] = isGregorianLeap(year) ? 29 : 28;
|
|
103
117
|
for (let i = 1; i <= GREGORIAN_NUMBER_OF_MONTHS; i += 1) {
|
|
104
118
|
if (n <= monthDays[i]) {
|
|
105
119
|
day = n;
|
|
@@ -166,9 +180,35 @@ function toEC(dateArray) {
|
|
|
166
180
|
*/
|
|
167
181
|
const WEEK_NAMES = ['እሑድ', 'ሰኞ', 'ማክሰኞ', 'ረቡዕ', 'ሓሙስ', 'ዓርብ', 'ቅዳሜ'];
|
|
168
182
|
const MONTHS_NAMES = [
|
|
169
|
-
'መስከረም',
|
|
183
|
+
'መስከረም',
|
|
184
|
+
'ጥቅምት',
|
|
185
|
+
'ኅዳር',
|
|
186
|
+
'ታኅሣሥ',
|
|
187
|
+
'ጥር',
|
|
188
|
+
'የካቲት',
|
|
189
|
+
'መጋቢት',
|
|
190
|
+
'ሚያዝያ',
|
|
191
|
+
'ግንቦት',
|
|
192
|
+
'ሰኔ',
|
|
193
|
+
'ሐምሌ',
|
|
194
|
+
'ነሐሴ',
|
|
195
|
+
'ጳጉሜን',
|
|
196
|
+
];
|
|
197
|
+
const SHORT_MONTHS_NAMES = [
|
|
198
|
+
'መስከ',
|
|
199
|
+
'ጥቅም',
|
|
200
|
+
'ኅዳር',
|
|
201
|
+
'ታኅሣ',
|
|
202
|
+
'ጥር',
|
|
203
|
+
'የካቲ',
|
|
204
|
+
'መጋቢ',
|
|
205
|
+
'ሚያዝ',
|
|
206
|
+
'ግንቦ',
|
|
207
|
+
'ሰኔ',
|
|
208
|
+
'ሐምሌ',
|
|
209
|
+
'ነሐሴ',
|
|
210
|
+
'ጳጉሜ',
|
|
170
211
|
];
|
|
171
|
-
const SHORT_MONTHS_NAMES = ['መስከ', 'ጥቅም', 'ኅዳር', 'ታኅሣ', 'ጥር', 'የካቲ', 'መጋቢ', 'ሚያዝ', 'ግንቦ', 'ሰኔ', 'ሐምሌ', 'ነሐሴ', 'ጳጉሜ'];
|
|
172
212
|
|
|
173
213
|
/**
|
|
174
214
|
* @license
|
|
@@ -210,14 +250,20 @@ class EthiopianDate {
|
|
|
210
250
|
if (result == null) {
|
|
211
251
|
throw new Error('Invalid Argument Exception');
|
|
212
252
|
}
|
|
213
|
-
[this._year, this._month, this._date] =
|
|
214
|
-
|
|
253
|
+
[this._year, this._month, this._date] = [
|
|
254
|
+
result.getFullYear(),
|
|
255
|
+
result.getMonth(),
|
|
256
|
+
result.getDate(),
|
|
257
|
+
];
|
|
215
258
|
this._gc = EthiopianDate.ethiopianToGregorian(this._year, this._month, this._date);
|
|
216
259
|
}
|
|
217
260
|
else if (typeof val === 'object' && val instanceof Date) {
|
|
218
|
-
const result = EthiopianDate.gregorianToEthiopian(val
|
|
219
|
-
[this._year, this._month, this._date] =
|
|
220
|
-
|
|
261
|
+
const result = EthiopianDate.gregorianToEthiopian(val);
|
|
262
|
+
[this._year, this._month, this._date] = [
|
|
263
|
+
result.getFullYear(),
|
|
264
|
+
result.getMonth(),
|
|
265
|
+
result.getDate(),
|
|
266
|
+
];
|
|
221
267
|
this._gc = EthiopianDate.ethiopianToGregorian(this._year, this._month, this._date);
|
|
222
268
|
}
|
|
223
269
|
else {
|
|
@@ -257,9 +303,9 @@ class EthiopianDate {
|
|
|
257
303
|
return this._month >= 0 && this._month < MONTHS_NAMES.length ? MONTHS_NAMES[this._month] : null;
|
|
258
304
|
}
|
|
259
305
|
getShortMonthName() {
|
|
260
|
-
return this._month >= 0 && this._month < SHORT_MONTHS_NAMES.length
|
|
261
|
-
SHORT_MONTHS_NAMES[this._month]
|
|
262
|
-
null;
|
|
306
|
+
return this._month >= 0 && this._month < SHORT_MONTHS_NAMES.length
|
|
307
|
+
? SHORT_MONTHS_NAMES[this._month]
|
|
308
|
+
: null;
|
|
263
309
|
}
|
|
264
310
|
getHours() {
|
|
265
311
|
return 0;
|
|
@@ -282,7 +328,7 @@ class EthiopianDate {
|
|
|
282
328
|
* @param val - A numeric year value if the second and third parameters are
|
|
283
329
|
* provided, it should be a date string if not
|
|
284
330
|
* @param month A zero-based numeric value for the month
|
|
285
|
-
* (0 for
|
|
331
|
+
* (0 for መስከረም, 12 for ጳጉሜን)
|
|
286
332
|
* @param day A numeric value equal for the day of the month.
|
|
287
333
|
*
|
|
288
334
|
* @api public
|
|
@@ -311,6 +357,16 @@ class EthiopianDate {
|
|
|
311
357
|
const gc = toGC(ec);
|
|
312
358
|
return new Date(gc[0], gc[1] - 1, gc[2]);
|
|
313
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
*
|
|
362
|
+
* @param val - A numeric year value if the second and third parameters are
|
|
363
|
+
* provided, it should be a date string if not
|
|
364
|
+
* @param month A zero-based numeric value for the month
|
|
365
|
+
* (0 for January, 11 for December)
|
|
366
|
+
* @param day A numeric value equal for the day of the month.
|
|
367
|
+
*
|
|
368
|
+
* @api public
|
|
369
|
+
*/
|
|
314
370
|
static gregorianToEthiopian(val, month, day) {
|
|
315
371
|
let gc;
|
|
316
372
|
if (val != null && month == null && day == null && typeof val !== 'number') {
|
|
@@ -540,7 +596,7 @@ class AjfEthiopianCalendarService extends AjfCalendarService {
|
|
|
540
596
|
const ecDate = EthiopianDate.gregorianToEthiopian(viewDate);
|
|
541
597
|
let curYear = ecDate.getFullYear();
|
|
542
598
|
let firstYear = curYear - (curYear % 10) + 1;
|
|
543
|
-
let curDate = EthiopianDate.ethiopianToGregorian(firstYear,
|
|
599
|
+
let curDate = EthiopianDate.ethiopianToGregorian(firstYear, 0, 1);
|
|
544
600
|
let rows = [];
|
|
545
601
|
for (let i = 0; i < 4; i++) {
|
|
546
602
|
let row = [];
|
|
@@ -556,9 +612,9 @@ class AjfEthiopianCalendarService extends AjfCalendarService {
|
|
|
556
612
|
return rows;
|
|
557
613
|
}
|
|
558
614
|
}
|
|
559
|
-
AjfEthiopianCalendarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-
|
|
560
|
-
AjfEthiopianCalendarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-
|
|
561
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-
|
|
615
|
+
AjfEthiopianCalendarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianCalendarService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
616
|
+
AjfEthiopianCalendarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianCalendarService, providedIn: 'root' });
|
|
617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianCalendarService, decorators: [{
|
|
562
618
|
type: Injectable,
|
|
563
619
|
args: [{ providedIn: 'root' }]
|
|
564
620
|
}] });
|
|
@@ -589,7 +645,7 @@ class AjfEthiopianDatePipe {
|
|
|
589
645
|
try {
|
|
590
646
|
const ed = EthiopianDate.gregorianToEthiopian(value);
|
|
591
647
|
const date = `0${ed.getDate()}`.slice(-2);
|
|
592
|
-
const month = `0${ed.getMonth()}`.slice(-2);
|
|
648
|
+
const month = `0${ed.getMonth() + 1}`.slice(-2);
|
|
593
649
|
return `${date}/${month}/${ed.getFullYear()}`;
|
|
594
650
|
}
|
|
595
651
|
catch (e) {
|
|
@@ -597,10 +653,10 @@ class AjfEthiopianDatePipe {
|
|
|
597
653
|
}
|
|
598
654
|
}
|
|
599
655
|
}
|
|
600
|
-
AjfEthiopianDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-
|
|
601
|
-
AjfEthiopianDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.0-
|
|
602
|
-
AjfEthiopianDatePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-
|
|
603
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-
|
|
656
|
+
AjfEthiopianDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
657
|
+
AjfEthiopianDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianDatePipe, name: "ajfEthiopianDate" });
|
|
658
|
+
AjfEthiopianDatePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianDatePipe });
|
|
659
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianDatePipe, decorators: [{
|
|
604
660
|
type: Injectable
|
|
605
661
|
}, {
|
|
606
662
|
type: Pipe,
|
|
@@ -630,23 +686,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15",
|
|
|
630
686
|
*/
|
|
631
687
|
class AjfEthiopianCalendarModule {
|
|
632
688
|
}
|
|
633
|
-
AjfEthiopianCalendarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-
|
|
634
|
-
AjfEthiopianCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0-
|
|
635
|
-
AjfEthiopianCalendarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0-
|
|
636
|
-
|
|
637
|
-
] });
|
|
638
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: AjfEthiopianCalendarModule, decorators: [{
|
|
689
|
+
AjfEthiopianCalendarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianCalendarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
690
|
+
AjfEthiopianCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianCalendarModule, declarations: [AjfEthiopianDatePipe], exports: [AjfEthiopianDatePipe] });
|
|
691
|
+
AjfEthiopianCalendarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianCalendarModule, providers: [{ provide: AjfCalendarService, useClass: AjfEthiopianCalendarService }] });
|
|
692
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.3", ngImport: i0, type: AjfEthiopianCalendarModule, decorators: [{
|
|
639
693
|
type: NgModule,
|
|
640
694
|
args: [{
|
|
641
|
-
declarations: [
|
|
642
|
-
|
|
643
|
-
],
|
|
644
|
-
exports: [
|
|
645
|
-
AjfEthiopianDatePipe,
|
|
646
|
-
],
|
|
647
|
-
providers: [
|
|
648
|
-
{ provide: AjfCalendarService, useClass: AjfEthiopianCalendarService },
|
|
649
|
-
],
|
|
695
|
+
declarations: [AjfEthiopianDatePipe],
|
|
696
|
+
exports: [AjfEthiopianDatePipe],
|
|
697
|
+
providers: [{ provide: AjfCalendarService, useClass: AjfEthiopianCalendarService }],
|
|
650
698
|
}]
|
|
651
699
|
}] });
|
|
652
700
|
|
|
@@ -672,6 +720,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15",
|
|
|
672
720
|
*
|
|
673
721
|
*/
|
|
674
722
|
|
|
723
|
+
/**
|
|
724
|
+
* @license
|
|
725
|
+
* Copyright (C) Gnucoop soc. coop.
|
|
726
|
+
*
|
|
727
|
+
* This file is part of the Advanced JSON forms (ajf).
|
|
728
|
+
*
|
|
729
|
+
* Advanced JSON forms (ajf) is free software: you can redistribute it and/or
|
|
730
|
+
* modify it under the terms of the GNU Affero General Public License as
|
|
731
|
+
* published by the Free Software Foundation, either version 3 of the License,
|
|
732
|
+
* or (at your option) any later version.
|
|
733
|
+
*
|
|
734
|
+
* Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
|
|
735
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
736
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
|
|
737
|
+
* General Public License for more details.
|
|
738
|
+
*
|
|
739
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
740
|
+
* along with Advanced JSON forms (ajf).
|
|
741
|
+
* If not, see http://www.gnu.org/licenses/.
|
|
742
|
+
*
|
|
743
|
+
*/
|
|
744
|
+
|
|
675
745
|
/**
|
|
676
746
|
* Generated bundle index. Do not edit.
|
|
677
747
|
*/
|