mihrab-methods 1.3.2 → 1.5.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/README.md +4 -3
- package/certification.json +27 -4
- package/data/corrections/diyanet.json +48 -316
- package/data/corrections/kazakhstan.json +5 -0
- package/dist/cjs/authorities/kazakhstan.d.ts +3 -0
- package/dist/cjs/authorities/kazakhstan.js +49 -0
- package/dist/cjs/core/compute.js +8 -4
- package/dist/cjs/core/types.d.ts +1 -1
- package/dist/cjs/core/types.js +1 -1
- package/dist/cjs/data/generated/diyanetCertification.js +1 -1
- package/dist/cjs/data/generated/diyanetCorrections.js +1 -1
- package/dist/cjs/data/generated/diyanetWorldPoints.js +1 -1
- package/dist/cjs/data/generated/kazakhstanCertification.d.ts +3 -0
- package/dist/cjs/data/generated/kazakhstanCertification.js +4 -0
- package/dist/cjs/data/generated/kazakhstanCities.d.ts +7 -0
- package/dist/cjs/data/generated/kazakhstanCities.js +5 -0
- package/dist/cjs/data/generated/kazakhstanCorrections.d.ts +3 -0
- package/dist/cjs/data/generated/kazakhstanCorrections.js +4 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/kazakhstan.d.ts +4 -0
- package/dist/cjs/kazakhstan.js +22 -0
- package/dist/cjs/methods/kazakhstan.d.ts +58 -0
- package/dist/cjs/methods/kazakhstan.js +129 -0
- package/dist/cjs/methods/revisions.d.ts +2 -1
- package/dist/cjs/methods/revisions.js +2 -1
- package/dist/esm/authorities/kazakhstan.d.ts +3 -0
- package/dist/esm/authorities/kazakhstan.js +43 -0
- package/dist/esm/core/compute.js +8 -4
- package/dist/esm/core/types.d.ts +1 -1
- package/dist/esm/core/types.js +1 -1
- package/dist/esm/data/generated/diyanetCertification.js +1 -1
- package/dist/esm/data/generated/diyanetCorrections.js +1 -1
- package/dist/esm/data/generated/diyanetWorldPoints.js +1 -1
- package/dist/esm/data/generated/kazakhstanCertification.d.ts +3 -0
- package/dist/esm/data/generated/kazakhstanCertification.js +2 -0
- package/dist/esm/data/generated/kazakhstanCities.d.ts +7 -0
- package/dist/esm/data/generated/kazakhstanCities.js +3 -0
- package/dist/esm/data/generated/kazakhstanCorrections.d.ts +3 -0
- package/dist/esm/data/generated/kazakhstanCorrections.js +2 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/kazakhstan.d.ts +4 -0
- package/dist/esm/kazakhstan.js +4 -0
- package/dist/esm/methods/kazakhstan.d.ts +58 -0
- package/dist/esm/methods/kazakhstan.js +124 -0
- package/dist/esm/methods/revisions.d.ts +2 -1
- package/dist/esm/methods/revisions.js +2 -1
- package/docs/methods.md +29 -0
- package/package.json +17 -2
- package/schemas/certification.schema.json +2 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const data = { "certified": true, "checkedAt": "2026-11-11", "places": 84, "checks": [{ "tables": "Kazakhstan — the Spiritual Administration’s times", "places": 84, "times": 551880, "off": 0, "offWithoutCorrections": 0, "from": "2025-01-01", "to": "2027-12-31" }], "corrections": { "from": "2025-01-01", "to": "2027-12-31", "entries": 0, "sha256": "e3d60e566ca082f74ce9904886087b29e65d2871c5bcc02f46349d82c8994d88" }, "revision": 1 };
|
|
2
|
+
export default data;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Generated by scripts/embed.mjs — do not edit; edit the JSON under data/ instead.
|
|
2
|
+
const data = [{ "id": 2, "name": "Қонаев", "lat": 43.883333, "lon": 77.083333 }, { "id": 3, "name": "Астана", "lat": 51.133333, "lon": 71.433333 }, { "id": 7, "name": "Орал", "lat": 51.204019, "lon": 51.370537 }, { "id": 17, "name": "Көкшетау", "lat": 53.291667, "lon": 69.391667 }, { "id": 18, "name": "Атырау", "lat": 47.116667, "lon": 51.883333 }, { "id": 20, "name": "Ақтөбе", "lat": 50.300377, "lon": 57.154555 }, { "id": 21, "name": "Степногорск", "lat": 52.346944, "lon": 71.881667 }, { "id": 22, "name": "Үшарал", "lat": 46.169722, "lon": 80.939444 }, { "id": 23, "name": "Атбасар", "lat": 51.815761, "lon": 68.358335 }, { "id": 24, "name": "Қандыағаш", "lat": 49.474444, "lon": 57.423333 }, { "id": 25, "name": "Хромтау", "lat": 50.250278, "lon": 58.434722 }, { "id": 26, "name": "Шалқар", "lat": 47.831392, "lon": 59.61929 }, { "id": 27, "name": "Құлсары", "lat": 46.983333, "lon": 54.016667 }, { "id": 29, "name": "Аягөз", "lat": 47.966667, "lon": 80.433333 }, { "id": 30, "name": "Өскемен", "lat": 49.948325, "lon": 82.627848 }, { "id": 31, "name": "Риддер", "lat": 50.33886, "lon": 83.506329 }, { "id": 32, "name": "Семей", "lat": 50.404976, "lon": 80.249235 }, { "id": 33, "name": "Жаңатас", "lat": 43.55465, "lon": 69.722525 }, { "id": 34, "name": "Қаратау", "lat": 43.166667, "lon": 70.466667 }, { "id": 35, "name": "Тараз", "lat": 42.883333, "lon": 71.366667 }, { "id": 36, "name": "Балқаш", "lat": 46.843721, "lon": 74.977301 }, { "id": 38, "name": "Жезқазған", "lat": 47.799711, "lon": 67.71409 }, { "id": 39, "name": "Қарағанды", "lat": 49.806406, "lon": 73.085485 }, { "id": 40, "name": "Сәтпаев", "lat": 47.907455, "lon": 67.528112 }, { "id": 41, "name": "Арқалық", "lat": 50.248611, "lon": 66.911389 }, { "id": 42, "name": "Қостанай", "lat": 53.219333, "lon": 63.634194 }, { "id": 43, "name": "Рудный", "lat": 52.966667, "lon": 63.116667 }, { "id": 46, "name": "Қызылорда", "lat": 44.842544, "lon": 65.502563 }, { "id": 47, "name": "Ақтау", "lat": 43.635379, "lon": 51.169135 }, { "id": 49, "name": "Форт-Шевченко", "lat": 44.507463, "lon": 50.262833 }, { "id": 50, "name": "Жаңаөзен", "lat": 43.343266, "lon": 52.865792 }, { "id": 51, "name": "Петропавл", "lat": 54.862222, "lon": 69.140833 }, { "id": 52, "name": "Екібастұз", "lat": 51.729778, "lon": 75.326583 }, { "id": 53, "name": "Павлодар", "lat": 52.315556, "lon": 76.956389 }, { "id": 54, "name": "Жетісай", "lat": 40.775278, "lon": 68.327222 }, { "id": 55, "name": "Сарыағаш", "lat": 41.466667, "lon": 69.166667 }, { "id": 56, "name": "Шардара", "lat": 41.254722, "lon": 67.969167 }, { "id": 57, "name": "Шымкент", "lat": 42.368009, "lon": 69.612769 }, { "id": 58, "name": "Түркістан", "lat": 43.302025, "lon": 68.268979 }, { "id": 59, "name": "Ақсай", "lat": 51.164945, "lon": 53.020868 }, { "id": 69, "name": "Лисаков", "lat": 52.544079, "lon": 62.492641 }, { "id": 70, "name": "Жаркент", "lat": 44.169365, "lon": 80.003842 }, { "id": 71, "name": "Арал", "lat": 46.797738, "lon": 61.660792 }, { "id": 72, "name": "Алматы", "lat": 43.238293, "lon": 76.945465 }, { "id": 73, "name": "Талғар", "lat": 43.302813, "lon": 77.23969 }, { "id": 75, "name": "Қаскелең", "lat": 43.202449, "lon": 76.622278 }, { "id": 77, "name": "Шу", "lat": 43.611782, "lon": 73.760237 }, { "id": 79, "name": "Қаражал", "lat": 48.001042, "lon": 70.785762 }, { "id": 82, "name": "Ленгер", "lat": 42.182051, "lon": 69.88212 }, { "id": 93, "name": "Ембі", "lat": 48.823344, "lon": 58.148397 }, { "id": 95, "name": "Зайсан", "lat": 47.453008, "lon": 84.969846 }, { "id": 100, "name": "Кентау", "lat": 43.518131, "lon": 68.504652 }, { "id": 103, "name": "Тайынша", "lat": 53.852738, "lon": 69.782631 }, { "id": 109, "name": "Теміртау", "lat": 50.058756, "lon": 72.953424 }, { "id": 112, "name": "Алға", "lat": 49.89673, "lon": 57.328586 }, { "id": 113, "name": "Ақсу", "lat": 52.03789, "lon": 76.920582 }, { "id": 128, "name": "Курчатов", "lat": 50.7549, "lon": 78.544826 }, { "id": 134, "name": "Арыс", "lat": 42.432744, "lon": 68.813798 }, { "id": 137, "name": "Қосшы", "lat": 50.970262, "lon": 71.355366 }, { "id": 143, "name": "Текелі", "lat": 44.863094, "lon": 78.764266 }, { "id": 146, "name": "Қарқаралы", "lat": 49.41224, "lon": 75.470095 }, { "id": 149, "name": "Шар", "lat": 49.584964, "lon": 81.047173 }, { "id": 150, "name": "Ақкөл", "lat": 51.995855, "lon": 70.952948 }, { "id": 151, "name": "Державинск", "lat": 51.098685, "lon": 66.314712 }, { "id": 152, "name": "Ерейментау", "lat": 51.619626, "lon": 73.102598 }, { "id": 153, "name": "Есіл", "lat": 51.958004, "lon": 66.406215 }, { "id": 154, "name": "Макинск", "lat": 52.63281, "lon": 70.417677 }, { "id": 155, "name": "Степняк", "lat": 52.832, "lon": 70.783427 }, { "id": 157, "name": "Жем", "lat": 48.774532, "lon": 58.072436 }, { "id": 158, "name": "Темір", "lat": 49.143142, "lon": 57.12633 }, { "id": 159, "name": "Алатау", "lat": 43.681261, "lon": 77.116046 }, { "id": 161, "name": "Сарқан", "lat": 45.413666, "lon": 79.916894 }, { "id": 162, "name": "Талдықорған", "lat": 45.017837, "lon": 78.382123 }, { "id": 163, "name": "Үштөбе", "lat": 45.251221, "lon": 77.980827 }, { "id": 165, "name": "Приозёрск", "lat": 46.028969, "lon": 73.708027 }, { "id": 166, "name": "Саран", "lat": 49.801993, "lon": 72.828387 }, { "id": 167, "name": "Шахтинск", "lat": 49.705868, "lon": 72.594637 }, { "id": 170, "name": "Қазалы", "lat": 45.760633, "lon": 62.105836 }, { "id": 171, "name": "Булаев", "lat": 54.896056, "lon": 70.448157 }, { "id": 172, "name": "Мамлют", "lat": 54.94112, "lon": 68.546199 }, { "id": 173, "name": "Сергеев", "lat": 53.888542, "lon": 67.416271 }, { "id": 174, "name": "Алтай", "lat": 49.725218, "lon": 84.273562 }, { "id": 175, "name": "Серебрянск", "lat": 49.679277, "lon": 83.300651 }, { "id": 176, "name": "Шемонаиха", "lat": 50.627624, "lon": 81.916697 }];
|
|
3
|
+
export default data;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -16,5 +16,6 @@ import './authorities/morocco.js';
|
|
|
16
16
|
import './authorities/algeria.js';
|
|
17
17
|
import './authorities/indonesia.js';
|
|
18
18
|
import './authorities/turkiyeTakvimi.js';
|
|
19
|
+
import './authorities/kazakhstan.js';
|
|
19
20
|
export * from './core/index.js';
|
|
20
21
|
export { diyanetCountry } from './authorities/diyanet.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -16,5 +16,6 @@ import './authorities/morocco.js';
|
|
|
16
16
|
import './authorities/algeria.js';
|
|
17
17
|
import './authorities/indonesia.js';
|
|
18
18
|
import './authorities/turkiyeTakvimi.js';
|
|
19
|
+
import './authorities/kazakhstan.js';
|
|
19
20
|
export * from './core/index.js';
|
|
20
21
|
export { diyanetCountry } from './authorities/diyanet.js';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kazakhstan — the Spiritual Administration of Muslims of Kazakhstan's
|
|
3
|
+
* method, as the times it publishes for a place are computed.
|
|
4
|
+
*
|
|
5
|
+
* Read off its published year for places from 40.8° to 54.9° N:
|
|
6
|
+
*
|
|
7
|
+
* • a short series for the sun: mean anomaly g and mean longitude q linear
|
|
8
|
+
* in the days D from J2000.0, the ecliptic longitude
|
|
9
|
+
* L = q + 1.915° sin g + 0.020° sin 2g, the obliquity 23.439° − 0.00000036° D,
|
|
10
|
+
* and from them the declination and the equation of time;
|
|
11
|
+
* • the day counted from 0h of the civil date at the place's own meridian
|
|
12
|
+
* (the Julian day of the date less longitude/360);
|
|
13
|
+
* • each time computed once, with the sun taken at a fixed first guess of
|
|
14
|
+
* its hour (Fajr 5h, sunrise 6h, Dhuhr 12h, Asr 13h, sunset and Isha
|
|
15
|
+
* 18h), not iterated;
|
|
16
|
+
* • Fajr and Isha at 15°; sunrise and sunset at −0.833°; Asr at two shadow
|
|
17
|
+
* lengths beyond the noon shadow (Hanafi);
|
|
18
|
+
* • where Fajr would fall more than a quarter of the night before sunrise,
|
|
19
|
+
* or Isha more than a quarter of the night after sunset — or the sun does
|
|
20
|
+
* not reach 15° — the quarter of the night is taken (the night from
|
|
21
|
+
* sunset to sunrise);
|
|
22
|
+
* • a margin of 3 minutes, 5 minutes from 48° N: sunrise that much
|
|
23
|
+
* earlier, Dhuhr and Asr that much later, Maghrib that much after
|
|
24
|
+
* sunset; none on Fajr or Isha;
|
|
25
|
+
* • every time rounded to the nearest minute.
|
|
26
|
+
*
|
|
27
|
+
* With that the method gives every published time of the places read, with
|
|
28
|
+
* no correction list.
|
|
29
|
+
*/
|
|
30
|
+
export type KazakhstanInstants = {
|
|
31
|
+
fajr: Date;
|
|
32
|
+
sunrise: Date;
|
|
33
|
+
dhuhr: Date;
|
|
34
|
+
asr: Date;
|
|
35
|
+
maghrib: Date;
|
|
36
|
+
isha: Date;
|
|
37
|
+
};
|
|
38
|
+
/** The margin at a latitude, minutes. */
|
|
39
|
+
export declare function kazakhstanMargin(latitude: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* The times before rounding, minutes past 00:00 UT of the civil date (month
|
|
42
|
+
* 0-based), and the sunset the method prints beside Maghrib.
|
|
43
|
+
*/
|
|
44
|
+
export declare function kazakhstanRawMinutes(latitude: number, longitude: number, year: number, month: number, day: number): {
|
|
45
|
+
fajr: number;
|
|
46
|
+
sunrise: number;
|
|
47
|
+
dhuhr: number;
|
|
48
|
+
asr: number;
|
|
49
|
+
sunset: number;
|
|
50
|
+
maghrib: number;
|
|
51
|
+
isha: number;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* The Administration's times for the civil date (month 0-based) at the
|
|
55
|
+
* point, each on the minute it prints (rounded to the nearest); Asr is the
|
|
56
|
+
* Hanafi one its table carries. Null where a time does not form.
|
|
57
|
+
*/
|
|
58
|
+
export declare function kazakhstanTimes(latitude: number, longitude: number, year: number, month: number, day: number): KazakhstanInstants | null;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kazakhstan — the Spiritual Administration of Muslims of Kazakhstan's
|
|
3
|
+
* method, as the times it publishes for a place are computed.
|
|
4
|
+
*
|
|
5
|
+
* Read off its published year for places from 40.8° to 54.9° N:
|
|
6
|
+
*
|
|
7
|
+
* • a short series for the sun: mean anomaly g and mean longitude q linear
|
|
8
|
+
* in the days D from J2000.0, the ecliptic longitude
|
|
9
|
+
* L = q + 1.915° sin g + 0.020° sin 2g, the obliquity 23.439° − 0.00000036° D,
|
|
10
|
+
* and from them the declination and the equation of time;
|
|
11
|
+
* • the day counted from 0h of the civil date at the place's own meridian
|
|
12
|
+
* (the Julian day of the date less longitude/360);
|
|
13
|
+
* • each time computed once, with the sun taken at a fixed first guess of
|
|
14
|
+
* its hour (Fajr 5h, sunrise 6h, Dhuhr 12h, Asr 13h, sunset and Isha
|
|
15
|
+
* 18h), not iterated;
|
|
16
|
+
* • Fajr and Isha at 15°; sunrise and sunset at −0.833°; Asr at two shadow
|
|
17
|
+
* lengths beyond the noon shadow (Hanafi);
|
|
18
|
+
* • where Fajr would fall more than a quarter of the night before sunrise,
|
|
19
|
+
* or Isha more than a quarter of the night after sunset — or the sun does
|
|
20
|
+
* not reach 15° — the quarter of the night is taken (the night from
|
|
21
|
+
* sunset to sunrise);
|
|
22
|
+
* • a margin of 3 minutes, 5 minutes from 48° N: sunrise that much
|
|
23
|
+
* earlier, Dhuhr and Asr that much later, Maghrib that much after
|
|
24
|
+
* sunset; none on Fajr or Isha;
|
|
25
|
+
* • every time rounded to the nearest minute.
|
|
26
|
+
*
|
|
27
|
+
* With that the method gives every published time of the places read, with
|
|
28
|
+
* no correction list.
|
|
29
|
+
*/
|
|
30
|
+
const RAD = Math.PI / 180;
|
|
31
|
+
const sin = (d) => Math.sin(d * RAD);
|
|
32
|
+
const cos = (d) => Math.cos(d * RAD);
|
|
33
|
+
const tan = (d) => Math.tan(d * RAD);
|
|
34
|
+
/** a − b·⌊a/b⌋: into [0, b). */
|
|
35
|
+
const fix = (a, b) => a - b * Math.floor(a / b);
|
|
36
|
+
/** Fajr's and Isha's depression, degrees. */
|
|
37
|
+
const TWILIGHT = 15;
|
|
38
|
+
const HORIZON = 0.833;
|
|
39
|
+
/** Shadow lengths beyond the noon shadow at Asr. */
|
|
40
|
+
const ASR_SHADOW = 2;
|
|
41
|
+
/** The latitude from which the margin is five minutes, not three. */
|
|
42
|
+
const NORTH = 48;
|
|
43
|
+
/** The first guess of each time's hour, at which its sun is taken. */
|
|
44
|
+
const GUESS = { fajr: 5, sunrise: 6, dhuhr: 12, asr: 13, sunset: 18, isha: 18 };
|
|
45
|
+
/** The Julian day of 0h UT of a civil date (month 1-based). */
|
|
46
|
+
function julian(year, month, day) {
|
|
47
|
+
if (month <= 2) {
|
|
48
|
+
year -= 1;
|
|
49
|
+
month += 12;
|
|
50
|
+
}
|
|
51
|
+
const a = Math.floor(year / 100);
|
|
52
|
+
const b = 2 - a + Math.floor(a / 4);
|
|
53
|
+
return Math.floor(365.25 * (year + 4716)) + Math.floor(30.6001 * (month + 1)) + day + b - 1524.5;
|
|
54
|
+
}
|
|
55
|
+
/** The method's sun at a Julian day: declination (degrees), equation of time (hours). */
|
|
56
|
+
function sunAt(jd) {
|
|
57
|
+
const D = jd - 2451545.0;
|
|
58
|
+
const g = fix(357.529 + 0.98560028 * D, 360);
|
|
59
|
+
const q = fix(280.459 + 0.98564736 * D, 360);
|
|
60
|
+
const L = fix(q + 1.915 * sin(g) + 0.02 * sin(2 * g), 360);
|
|
61
|
+
const e = 23.439 - 0.00000036 * D;
|
|
62
|
+
const ra = Math.atan2(cos(e) * sin(L), cos(L)) / RAD / 15;
|
|
63
|
+
return { decl: Math.asin(sin(e) * sin(L)) / RAD, eqt: q / 15 - fix(ra, 24) };
|
|
64
|
+
}
|
|
65
|
+
/** The margin at a latitude, minutes. */
|
|
66
|
+
export function kazakhstanMargin(latitude) {
|
|
67
|
+
return latitude >= NORTH ? 5 : 3;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The times before rounding, minutes past 00:00 UT of the civil date (month
|
|
71
|
+
* 0-based), and the sunset the method prints beside Maghrib.
|
|
72
|
+
*/
|
|
73
|
+
export function kazakhstanRawMinutes(latitude, longitude, year, month, day) {
|
|
74
|
+
const jd = julian(year, month + 1, day) - longitude / 360;
|
|
75
|
+
const midday = (t) => fix(12 - sunAt(jd + t).eqt, 24);
|
|
76
|
+
/** Hours (local mean time) at which the sun is `angle` degrees below the horizon; NaN where it is not. */
|
|
77
|
+
const at = (angle, t, before) => {
|
|
78
|
+
const { decl } = sunAt(jd + t);
|
|
79
|
+
const x = (-sin(angle) - sin(decl) * sin(latitude)) / (cos(decl) * cos(latitude));
|
|
80
|
+
if (!(Math.abs(x) <= 1))
|
|
81
|
+
return NaN;
|
|
82
|
+
const h = Math.acos(x) / RAD / 15;
|
|
83
|
+
return midday(t) + (before ? -h : h);
|
|
84
|
+
};
|
|
85
|
+
const asrAngle = (t) => -Math.atan(1 / (ASR_SHADOW + tan(Math.abs(latitude - sunAt(jd + t).decl)))) / RAD;
|
|
86
|
+
let fajr = at(TWILIGHT, GUESS.fajr / 24, true);
|
|
87
|
+
const sunrise = at(HORIZON, GUESS.sunrise / 24, true);
|
|
88
|
+
const dhuhr = midday(GUESS.dhuhr / 24);
|
|
89
|
+
const asr = at(asrAngle(GUESS.asr / 24), GUESS.asr / 24, false);
|
|
90
|
+
const sunset = at(HORIZON, GUESS.sunset / 24, false);
|
|
91
|
+
let isha = at(TWILIGHT, GUESS.isha / 24, false);
|
|
92
|
+
// the quarter of the night, where the angle is further than that or is not reached
|
|
93
|
+
const portion = (TWILIGHT / 60) * fix(sunrise - sunset, 24);
|
|
94
|
+
if (!Number.isFinite(fajr) || fix(sunrise - fajr, 24) > portion)
|
|
95
|
+
fajr = sunrise - portion;
|
|
96
|
+
if (!Number.isFinite(isha) || fix(isha - sunset, 24) > portion)
|
|
97
|
+
isha = sunset + portion;
|
|
98
|
+
const margin = kazakhstanMargin(latitude);
|
|
99
|
+
// local mean time (hours) to minutes past 00:00 UT of the date
|
|
100
|
+
const ut = (h) => (h - longitude / 15) * 60;
|
|
101
|
+
return {
|
|
102
|
+
fajr: ut(fajr),
|
|
103
|
+
sunrise: ut(sunrise) - margin,
|
|
104
|
+
dhuhr: ut(dhuhr) + margin,
|
|
105
|
+
asr: ut(asr) + margin,
|
|
106
|
+
sunset: ut(sunset),
|
|
107
|
+
maghrib: ut(sunset) + margin,
|
|
108
|
+
isha: ut(isha),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The Administration's times for the civil date (month 0-based) at the
|
|
113
|
+
* point, each on the minute it prints (rounded to the nearest); Asr is the
|
|
114
|
+
* Hanafi one its table carries. Null where a time does not form.
|
|
115
|
+
*/
|
|
116
|
+
export function kazakhstanTimes(latitude, longitude, year, month, day) {
|
|
117
|
+
const r = kazakhstanRawMinutes(latitude, longitude, year, month, day);
|
|
118
|
+
const all = [r.fajr, r.sunrise, r.dhuhr, r.asr, r.maghrib, r.isha];
|
|
119
|
+
if (!all.every(Number.isFinite))
|
|
120
|
+
return null;
|
|
121
|
+
const start = Date.UTC(year, month, day);
|
|
122
|
+
const at = (m) => new Date(start + Math.floor(m + 0.5) * 60_000);
|
|
123
|
+
return { fajr: at(r.fajr), sunrise: at(r.sunrise), dhuhr: at(r.dhuhr), asr: at(r.asr), maghrib: at(r.maghrib), isha: at(r.isha) };
|
|
124
|
+
}
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const METHOD_REVISION: {
|
|
10
10
|
readonly sweden: 1;
|
|
11
|
-
readonly diyanet:
|
|
11
|
+
readonly diyanet: 2;
|
|
12
12
|
readonly morocco: 2;
|
|
13
13
|
readonly algeria: 1;
|
|
14
14
|
readonly indonesia: 2;
|
|
15
15
|
readonly turkiyetakvimi: 1;
|
|
16
|
+
readonly kazakhstan: 1;
|
|
16
17
|
};
|
package/docs/methods.md
CHANGED
|
@@ -240,6 +240,35 @@ cities.
|
|
|
240
240
|
- The calendar's files give a city's point to the whole arc-minute and it
|
|
241
241
|
computes at a finer one; each place is at the point its year shows.
|
|
242
242
|
|
|
243
|
+
## Kazakhstan
|
|
244
|
+
|
|
245
|
+
`src/methods/kazakhstan.ts`. The Spiritual Administration of Muslims of
|
|
246
|
+
Kazakhstan's times, read off its cities from 40.8° to 54.9° N.
|
|
247
|
+
|
|
248
|
+
- A **short series for the sun**: the mean anomaly `g = 357.529° + 0.98560028° D`
|
|
249
|
+
and the mean longitude `q = 280.459° + 0.98564736° D`, with `D` the days
|
|
250
|
+
from J2000.0; the ecliptic longitude `L = q + 1.915° sin g + 0.020° sin 2g`;
|
|
251
|
+
the obliquity `23.439° − 0.00000036° D`; the declination and the equation
|
|
252
|
+
of time from those.
|
|
253
|
+
- The day is counted from **0h of the civil date at the place's own
|
|
254
|
+
meridian**: the Julian day of the date less `longitude / 360`.
|
|
255
|
+
- Each time is computed **once**, with the sun taken at a fixed first guess
|
|
256
|
+
of its hour — Fajr 5h, sunrise 6h, Dhuhr 12h, Asr 13h, sunset and Isha
|
|
257
|
+
18h — and not iterated.
|
|
258
|
+
- **Fajr** and **Isha**: the sun 15° below the horizon.
|
|
259
|
+
- **Sunrise** and sunset: the sun 0.833° below the horizon.
|
|
260
|
+
- **Asr**: two shadow lengths beyond the noon shadow (Hanafi), the one Asr
|
|
261
|
+
the Administration prints.
|
|
262
|
+
- **Where Fajr would fall more than a quarter of the night before sunrise,
|
|
263
|
+
or Isha more than a quarter of the night after sunset** — or the sun does
|
|
264
|
+
not reach 15° — the quarter of the night is taken, the night being from
|
|
265
|
+
sunset to sunrise.
|
|
266
|
+
- A **margin** of 3 minutes, 5 minutes from 48° N: sunrise that much
|
|
267
|
+
earlier, Dhuhr and Asr that much later, Maghrib that much after sunset.
|
|
268
|
+
None on Fajr or Isha.
|
|
269
|
+
- Every time rounded to the **nearest** minute.
|
|
270
|
+
- The whole country is on UTC+5, and every place is printed on it.
|
|
271
|
+
|
|
243
272
|
## Checking a port
|
|
244
273
|
|
|
245
274
|
1. Take `test/vectors.json`. For each case, compute the six times at the
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mihrab-methods",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "The prayer-time authorities' own calculation methods, each reproducing its published timetable to the minute: Sweden (Diyanet, as Islamiska Förbundet prints it), Diyanet worldwide, Morocco (Habous), Algeria (Ministry of Religious Affairs), Indonesia (Kemenag), Türkiye Takvimi.",
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "The prayer-time authorities' own calculation methods, each reproducing its published timetable to the minute: Sweden (Diyanet, as Islamiska Förbundet prints it), Diyanet worldwide, Morocco (Habous), Algeria (Ministry of Religious Affairs), Indonesia (Kemenag), Türkiye Takvimi, Kazakhstan (Spiritual Administration).",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "Hassan El Ghamri",
|
|
7
7
|
"repository": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"./dist/*/algeria.js",
|
|
30
30
|
"./dist/*/indonesia.js",
|
|
31
31
|
"./dist/*/turkiyetakvimi.js",
|
|
32
|
+
"./dist/*/kazakhstan.js",
|
|
32
33
|
"./dist/*/authorities/*.js",
|
|
33
34
|
"./src/index.ts",
|
|
34
35
|
"./src/sweden.ts",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"./src/algeria.ts",
|
|
38
39
|
"./src/indonesia.ts",
|
|
39
40
|
"./src/turkiyetakvimi.ts",
|
|
41
|
+
"./src/kazakhstan.ts",
|
|
40
42
|
"./src/authorities/*.ts"
|
|
41
43
|
],
|
|
42
44
|
"engines": {
|
|
@@ -133,6 +135,16 @@
|
|
|
133
135
|
"default": "./dist/cjs/turkiyetakvimi.js"
|
|
134
136
|
}
|
|
135
137
|
},
|
|
138
|
+
"./kazakhstan": {
|
|
139
|
+
"import": {
|
|
140
|
+
"types": "./dist/esm/kazakhstan.d.ts",
|
|
141
|
+
"default": "./dist/esm/kazakhstan.js"
|
|
142
|
+
},
|
|
143
|
+
"require": {
|
|
144
|
+
"types": "./dist/cjs/kazakhstan.d.ts",
|
|
145
|
+
"default": "./dist/cjs/kazakhstan.js"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
136
148
|
"./locate": {
|
|
137
149
|
"import": {
|
|
138
150
|
"types": "./dist/esm/locate.d.ts",
|
|
@@ -171,6 +183,9 @@
|
|
|
171
183
|
"turkiyetakvimi": [
|
|
172
184
|
"./dist/cjs/turkiyetakvimi.d.ts"
|
|
173
185
|
],
|
|
186
|
+
"kazakhstan": [
|
|
187
|
+
"./dist/cjs/kazakhstan.d.ts"
|
|
188
|
+
],
|
|
174
189
|
"locate": [
|
|
175
190
|
"./dist/cjs/locate.d.ts"
|
|
176
191
|
]
|