panchang-ts 2.0.0 → 2.0.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/dist/index.cjs +30 -23
- package/dist/index.js +30 -23
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3935,13 +3935,14 @@ function computeFestivals(ctx, nameResolver, rashiNameResolver) {
|
|
|
3935
3935
|
(adhikaBehaviour !== "shift-to-nija" || !ctx.isAdhika);
|
|
3936
3936
|
if (masaMatches) {
|
|
3937
3937
|
const dateRule = rule.dateRule ?? "sunrise";
|
|
3938
|
-
const
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3938
|
+
const endTithi = tithiForRule(dateRule);
|
|
3939
|
+
const startTithi = tithiForRuleStart(dateRule);
|
|
3940
|
+
const priorEndTithi = priorDayTithiForRule(dateRule);
|
|
3941
|
+
const matchedByEnd = endTithi === rule.tithi;
|
|
3942
|
+
const matchedByStart = dateRule !== "sunrise" && startTithi !== void 0 && startTithi === rule.tithi && endTithi !== rule.tithi;
|
|
3943
|
+
if (matchedByEnd || matchedByStart) {
|
|
3944
|
+
if (dateRule !== "sunrise" && startTithi !== void 0 && startTithi !== rule.tithi && priorEndTithi === rule.tithi) continue;
|
|
3945
|
+
if (matchedByStart && priorEndTithi === rule.tithi) continue;
|
|
3945
3946
|
match = true;
|
|
3946
3947
|
}
|
|
3947
3948
|
}
|
|
@@ -4001,26 +4002,32 @@ function computeFestivals(ctx, nameResolver, rashiNameResolver) {
|
|
|
4001
4002
|
if (tithiForRule("chandrodaya") === 18) {
|
|
4002
4003
|
results.push({ name: nameResolver("sankashti_chaturthi"), type: "major" });
|
|
4003
4004
|
}
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
const
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4005
|
+
{
|
|
4006
|
+
const endTithi = tithiForRule("nishita");
|
|
4007
|
+
const startTithi = ctx.tithiByRuleStart?.nishita;
|
|
4008
|
+
const priorEndTithi = ctx.priorDayTithiByRule?.nishita;
|
|
4009
|
+
const matchedByEnd = endTithi === 28;
|
|
4010
|
+
const matchedByStart = startTithi !== void 0 && startTithi === 28 && endTithi !== 28;
|
|
4011
|
+
if (matchedByEnd || matchedByStart) {
|
|
4012
|
+
const isMahaShivaratriMonth = !ctx.isAdhika && ctx.chandraMasaIndex === 10;
|
|
4013
|
+
const dedupeA = startTithi !== void 0 && startTithi !== 28 && priorEndTithi === 28;
|
|
4014
|
+
const dedupeB = matchedByStart && priorEndTithi === 28;
|
|
4015
|
+
if (!isMahaShivaratriMonth && !dedupeA && !dedupeB) {
|
|
4012
4016
|
results.push({ name: nameResolver("masik_shivaratri"), type: "minor" });
|
|
4013
4017
|
}
|
|
4014
4018
|
}
|
|
4015
4019
|
}
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
const
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4020
|
+
{
|
|
4021
|
+
const endTithi = tithiForRule("madhyahna");
|
|
4022
|
+
const startTithi = ctx.tithiByRuleStart?.madhyahna;
|
|
4023
|
+
const priorEndTithi = ctx.priorDayTithiByRule?.madhyahna;
|
|
4024
|
+
const matchedByEnd = endTithi === 3;
|
|
4025
|
+
const matchedByStart = startTithi !== void 0 && startTithi === 3 && endTithi !== 3;
|
|
4026
|
+
if (matchedByEnd || matchedByStart) {
|
|
4027
|
+
const isGaneshChaturthiMonth = !ctx.isAdhika && ctx.chandraMasaIndex === 5;
|
|
4028
|
+
const dedupeA = startTithi !== void 0 && startTithi !== 3 && priorEndTithi === 3;
|
|
4029
|
+
const dedupeB = matchedByStart && priorEndTithi === 3;
|
|
4030
|
+
if (!isGaneshChaturthiMonth && !dedupeA && !dedupeB) {
|
|
4024
4031
|
results.push({ name: nameResolver("vinayaka_chaturthi"), type: "minor" });
|
|
4025
4032
|
}
|
|
4026
4033
|
}
|
package/dist/index.js
CHANGED
|
@@ -3933,13 +3933,14 @@ function computeFestivals(ctx, nameResolver, rashiNameResolver) {
|
|
|
3933
3933
|
(adhikaBehaviour !== "shift-to-nija" || !ctx.isAdhika);
|
|
3934
3934
|
if (masaMatches) {
|
|
3935
3935
|
const dateRule = rule.dateRule ?? "sunrise";
|
|
3936
|
-
const
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3936
|
+
const endTithi = tithiForRule(dateRule);
|
|
3937
|
+
const startTithi = tithiForRuleStart(dateRule);
|
|
3938
|
+
const priorEndTithi = priorDayTithiForRule(dateRule);
|
|
3939
|
+
const matchedByEnd = endTithi === rule.tithi;
|
|
3940
|
+
const matchedByStart = dateRule !== "sunrise" && startTithi !== void 0 && startTithi === rule.tithi && endTithi !== rule.tithi;
|
|
3941
|
+
if (matchedByEnd || matchedByStart) {
|
|
3942
|
+
if (dateRule !== "sunrise" && startTithi !== void 0 && startTithi !== rule.tithi && priorEndTithi === rule.tithi) continue;
|
|
3943
|
+
if (matchedByStart && priorEndTithi === rule.tithi) continue;
|
|
3943
3944
|
match = true;
|
|
3944
3945
|
}
|
|
3945
3946
|
}
|
|
@@ -3999,26 +4000,32 @@ function computeFestivals(ctx, nameResolver, rashiNameResolver) {
|
|
|
3999
4000
|
if (tithiForRule("chandrodaya") === 18) {
|
|
4000
4001
|
results.push({ name: nameResolver("sankashti_chaturthi"), type: "major" });
|
|
4001
4002
|
}
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
const
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4003
|
+
{
|
|
4004
|
+
const endTithi = tithiForRule("nishita");
|
|
4005
|
+
const startTithi = ctx.tithiByRuleStart?.nishita;
|
|
4006
|
+
const priorEndTithi = ctx.priorDayTithiByRule?.nishita;
|
|
4007
|
+
const matchedByEnd = endTithi === 28;
|
|
4008
|
+
const matchedByStart = startTithi !== void 0 && startTithi === 28 && endTithi !== 28;
|
|
4009
|
+
if (matchedByEnd || matchedByStart) {
|
|
4010
|
+
const isMahaShivaratriMonth = !ctx.isAdhika && ctx.chandraMasaIndex === 10;
|
|
4011
|
+
const dedupeA = startTithi !== void 0 && startTithi !== 28 && priorEndTithi === 28;
|
|
4012
|
+
const dedupeB = matchedByStart && priorEndTithi === 28;
|
|
4013
|
+
if (!isMahaShivaratriMonth && !dedupeA && !dedupeB) {
|
|
4010
4014
|
results.push({ name: nameResolver("masik_shivaratri"), type: "minor" });
|
|
4011
4015
|
}
|
|
4012
4016
|
}
|
|
4013
4017
|
}
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
const
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4018
|
+
{
|
|
4019
|
+
const endTithi = tithiForRule("madhyahna");
|
|
4020
|
+
const startTithi = ctx.tithiByRuleStart?.madhyahna;
|
|
4021
|
+
const priorEndTithi = ctx.priorDayTithiByRule?.madhyahna;
|
|
4022
|
+
const matchedByEnd = endTithi === 3;
|
|
4023
|
+
const matchedByStart = startTithi !== void 0 && startTithi === 3 && endTithi !== 3;
|
|
4024
|
+
if (matchedByEnd || matchedByStart) {
|
|
4025
|
+
const isGaneshChaturthiMonth = !ctx.isAdhika && ctx.chandraMasaIndex === 5;
|
|
4026
|
+
const dedupeA = startTithi !== void 0 && startTithi !== 3 && priorEndTithi === 3;
|
|
4027
|
+
const dedupeB = matchedByStart && priorEndTithi === 3;
|
|
4028
|
+
if (!isGaneshChaturthiMonth && !dedupeA && !dedupeB) {
|
|
4022
4029
|
results.push({ name: nameResolver("vinayaka_chaturthi"), type: "minor" });
|
|
4023
4030
|
}
|
|
4024
4031
|
}
|
package/package.json
CHANGED