panchang-ts 0.4.2 → 0.5.1

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 CHANGED
@@ -44,7 +44,7 @@ import { getDailyPanchang } from 'panchang-ts';
44
44
 
45
45
  const result = getDailyPanchang(
46
46
  new Date(2025, 0, 14), // January 14, 2025
47
- { latitude: 18.5204, longitude: 73.8567 }, // Pune, India
47
+ { latitude: 23.1765, longitude: 75.7885 }, // Ujjain, India
48
48
  { timezone: 330 }, // IST = UTC+5:30 = 330 minutes
49
49
  );
50
50
 
package/dist/index.cjs CHANGED
@@ -3008,7 +3008,7 @@ function computeChandraMasa(siderealSun, siderealMoon, nameFn) {
3008
3008
  const sunAtNextNewMoon = (siderealSun + daysUntilNext / TROPICAL_YEAR * 360) % 360;
3009
3009
  const solarMonthAtNext = Math.floor(sunAtNextNewMoon / 30);
3010
3010
  const isAdhika = solarMonthAtPrev === solarMonthAtNext;
3011
- const index = solarMonthAtPrev;
3011
+ const index = (solarMonthAtPrev + 1) % 12;
3012
3012
  const name = nameFn(index, isAdhika);
3013
3013
  const isKrishnaPaksha = elongation >= 180;
3014
3014
  const purnimantaIndex = isKrishnaPaksha ? (index + 1) % 12 : index;
@@ -3219,11 +3219,12 @@ var FESTIVAL_REGISTRY = [
3219
3219
  { key: "maha_navami", masa: 6, tithi: 8, type: "major" },
3220
3220
  { key: "dussehra", masa: 6, tithi: 9, type: "major" },
3221
3221
  { key: "sharad_purnima", masa: 6, tithi: 14, type: "major" },
3222
- // Kartika (7)
3223
- { key: "karva_chauth", masa: 7, tithi: 18, type: "major" },
3224
- { key: "dhanteras", masa: 7, tithi: 27, type: "major" },
3225
- { key: "narak_chaturdashi", masa: 7, tithi: 28, type: "major" },
3226
- { key: "diwali", masa: 7, tithi: 29, type: "major" },
3222
+ // Ashwin (6) — Krishna Paksha festivals (Amanta: Ashwin; Purnimanta calls these "Kartika")
3223
+ { key: "karva_chauth", masa: 6, tithi: 18, type: "major" },
3224
+ { key: "dhanteras", masa: 6, tithi: 27, type: "major" },
3225
+ { key: "narak_chaturdashi", masa: 6, tithi: 28, type: "major" },
3226
+ { key: "diwali", masa: 6, tithi: 29, type: "major" },
3227
+ // Kartika (7) — Shukla Paksha
3227
3228
  { key: "kartika_purnima", masa: 7, tithi: 14, type: "minor" },
3228
3229
  // Magha (10)
3229
3230
  { key: "vasant_panchami", masa: 10, tithi: 4, type: "major" },
package/dist/index.d.cts CHANGED
@@ -224,7 +224,7 @@ interface InstantPanchangResult {
224
224
  *
225
225
  * const p = getInstantPanchang(
226
226
  * new Date('2025-01-14T03:00:00Z'),
227
- * { latitude: 18.5204, longitude: 73.8567 },
227
+ * { latitude: 23.1765, longitude: 75.7885 }, // Ujjain, India
228
228
  * { language: 'sa' },
229
229
  * );
230
230
  * console.log(p.tithi.name); // "कृष्ण चतुर्दशी"
@@ -263,7 +263,7 @@ declare function getInstantPanchang(date: Date, location: GeoLocation, options?:
263
263
  *
264
264
  * const result = getDailyPanchang(
265
265
  * new Date(2025, 0, 14), // Jan 14, 2025
266
- * { latitude: 18.5204, longitude: 73.8567 }, // Pune, India
266
+ * { latitude: 23.1765, longitude: 75.7885 }, // Ujjain, India
267
267
  * { timezone: 330 }, // IST = UTC+5:30
268
268
  * );
269
269
  *
package/dist/index.d.ts CHANGED
@@ -224,7 +224,7 @@ interface InstantPanchangResult {
224
224
  *
225
225
  * const p = getInstantPanchang(
226
226
  * new Date('2025-01-14T03:00:00Z'),
227
- * { latitude: 18.5204, longitude: 73.8567 },
227
+ * { latitude: 23.1765, longitude: 75.7885 }, // Ujjain, India
228
228
  * { language: 'sa' },
229
229
  * );
230
230
  * console.log(p.tithi.name); // "कृष्ण चतुर्दशी"
@@ -263,7 +263,7 @@ declare function getInstantPanchang(date: Date, location: GeoLocation, options?:
263
263
  *
264
264
  * const result = getDailyPanchang(
265
265
  * new Date(2025, 0, 14), // Jan 14, 2025
266
- * { latitude: 18.5204, longitude: 73.8567 }, // Pune, India
266
+ * { latitude: 23.1765, longitude: 75.7885 }, // Ujjain, India
267
267
  * { timezone: 330 }, // IST = UTC+5:30
268
268
  * );
269
269
  *
package/dist/index.js CHANGED
@@ -3006,7 +3006,7 @@ function computeChandraMasa(siderealSun, siderealMoon, nameFn) {
3006
3006
  const sunAtNextNewMoon = (siderealSun + daysUntilNext / TROPICAL_YEAR * 360) % 360;
3007
3007
  const solarMonthAtNext = Math.floor(sunAtNextNewMoon / 30);
3008
3008
  const isAdhika = solarMonthAtPrev === solarMonthAtNext;
3009
- const index = solarMonthAtPrev;
3009
+ const index = (solarMonthAtPrev + 1) % 12;
3010
3010
  const name = nameFn(index, isAdhika);
3011
3011
  const isKrishnaPaksha = elongation >= 180;
3012
3012
  const purnimantaIndex = isKrishnaPaksha ? (index + 1) % 12 : index;
@@ -3217,11 +3217,12 @@ var FESTIVAL_REGISTRY = [
3217
3217
  { key: "maha_navami", masa: 6, tithi: 8, type: "major" },
3218
3218
  { key: "dussehra", masa: 6, tithi: 9, type: "major" },
3219
3219
  { key: "sharad_purnima", masa: 6, tithi: 14, type: "major" },
3220
- // Kartika (7)
3221
- { key: "karva_chauth", masa: 7, tithi: 18, type: "major" },
3222
- { key: "dhanteras", masa: 7, tithi: 27, type: "major" },
3223
- { key: "narak_chaturdashi", masa: 7, tithi: 28, type: "major" },
3224
- { key: "diwali", masa: 7, tithi: 29, type: "major" },
3220
+ // Ashwin (6) — Krishna Paksha festivals (Amanta: Ashwin; Purnimanta calls these "Kartika")
3221
+ { key: "karva_chauth", masa: 6, tithi: 18, type: "major" },
3222
+ { key: "dhanteras", masa: 6, tithi: 27, type: "major" },
3223
+ { key: "narak_chaturdashi", masa: 6, tithi: 28, type: "major" },
3224
+ { key: "diwali", masa: 6, tithi: 29, type: "major" },
3225
+ // Kartika (7) — Shukla Paksha
3225
3226
  { key: "kartika_purnima", masa: 7, tithi: 14, type: "minor" },
3226
3227
  // Magha (10)
3227
3228
  { key: "vasant_panchami", masa: 10, tithi: 4, type: "major" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panchang-ts",
3
- "version": "0.4.2",
3
+ "version": "0.5.1",
4
4
  "description": "Pure TypeScript Hindu Panchang calculations. Tithi, Nakshatra, Yoga, Karana, Vara, and more. Offline-first, React Native compatible.",
5
5
  "author": "Ishank",
6
6
  "license": "MIT",