calendaryjs-plugin-liturgical 0.1.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/LICENSE +21 -0
- package/README.md +201 -0
- package/dist/index.cjs +3150 -0
- package/dist/index.d.cts +1064 -0
- package/dist/index.d.ts +1064 -0
- package/dist/index.js +3099 -0
- package/package.json +78 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 calendaryjs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# calendaryjs-plugin-liturgical
|
|
2
|
+
|
|
3
|
+
Liturgical calendar plugin for [Calendary](https://github.com/calendaryjs/calendaryjs). Adds support for Easter calculation and offset-based events.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **✝️ Easter Calculation** - Computus algorithm for accurate Easter dates
|
|
8
|
+
- **📅 Offset Events** - Events relative to Easter or other base events
|
|
9
|
+
- **⛪ Church Calendar** - Full liturgical year support
|
|
10
|
+
- **🔧 Flexible** - Works with any Christian denomination
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add calendaryjs calendaryjs-plugin-liturgical
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
|
|
20
|
+
- `calendaryjs` >= 0.1.0
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { calendary } from "calendaryjs";
|
|
26
|
+
import { liturgical } from "calendaryjs-plugin-liturgical";
|
|
27
|
+
|
|
28
|
+
const cal = calendary();
|
|
29
|
+
cal.use(liturgical());
|
|
30
|
+
|
|
31
|
+
cal.addGroup({
|
|
32
|
+
id: "church",
|
|
33
|
+
name: "Church Calendar",
|
|
34
|
+
events: [
|
|
35
|
+
{ type: "easter", id: "easter", title: "Easter Sunday" },
|
|
36
|
+
{ type: "offset", id: "ash-wed", baseEvent: "easter", offsetDays: -46, title: "Ash Wednesday" },
|
|
37
|
+
{
|
|
38
|
+
type: "offset",
|
|
39
|
+
id: "palm-sunday",
|
|
40
|
+
baseEvent: "easter",
|
|
41
|
+
offsetDays: -7,
|
|
42
|
+
title: "Palm Sunday",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: "offset",
|
|
46
|
+
id: "good-friday",
|
|
47
|
+
baseEvent: "easter",
|
|
48
|
+
offsetDays: -2,
|
|
49
|
+
title: "Good Friday",
|
|
50
|
+
},
|
|
51
|
+
{ type: "offset", id: "pentecost", baseEvent: "easter", offsetDays: 49, title: "Pentecost" },
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const events = cal.getEventsInRange("2025-01-01", "2025-12-31");
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Event Types
|
|
59
|
+
|
|
60
|
+
### `easter`
|
|
61
|
+
|
|
62
|
+
Easter Sunday, calculated using the Computus algorithm.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
{
|
|
66
|
+
type: 'easter';
|
|
67
|
+
id: string;
|
|
68
|
+
title?: string;
|
|
69
|
+
// ... other standard event properties
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### `offset`
|
|
74
|
+
|
|
75
|
+
Events offset from a base event (typically Easter).
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
{
|
|
79
|
+
type: 'offset';
|
|
80
|
+
id: string;
|
|
81
|
+
baseEvent: string; // ID of the base event
|
|
82
|
+
offsetDays: number; // Days offset (negative = before, positive = after)
|
|
83
|
+
title?: string;
|
|
84
|
+
// ... other standard event properties
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Common Liturgical Offsets
|
|
89
|
+
|
|
90
|
+
| Event | Offset from Easter |
|
|
91
|
+
| -------------- | ------------------ |
|
|
92
|
+
| Ash Wednesday | -46 |
|
|
93
|
+
| Palm Sunday | -7 |
|
|
94
|
+
| Holy Thursday | -3 |
|
|
95
|
+
| Good Friday | -2 |
|
|
96
|
+
| Holy Saturday | -1 |
|
|
97
|
+
| Easter Monday | +1 |
|
|
98
|
+
| Ascension | +39 |
|
|
99
|
+
| Pentecost | +49 |
|
|
100
|
+
| Trinity Sunday | +56 |
|
|
101
|
+
| Corpus Christi | +60 |
|
|
102
|
+
|
|
103
|
+
## Example: Full Liturgical Year
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { calendary } from "calendaryjs";
|
|
107
|
+
import { liturgical } from "calendaryjs-plugin-liturgical";
|
|
108
|
+
|
|
109
|
+
const cal = calendary();
|
|
110
|
+
cal.use(liturgical());
|
|
111
|
+
|
|
112
|
+
cal.addGroup({
|
|
113
|
+
id: "liturgical",
|
|
114
|
+
name: "Liturgical Calendar",
|
|
115
|
+
events: [
|
|
116
|
+
// Easter
|
|
117
|
+
{ type: "easter", id: "easter", title: "Easter Sunday" },
|
|
118
|
+
|
|
119
|
+
// Lent
|
|
120
|
+
{ type: "offset", id: "ash-wed", baseEvent: "easter", offsetDays: -46, title: "Ash Wednesday" },
|
|
121
|
+
|
|
122
|
+
// Holy Week
|
|
123
|
+
{
|
|
124
|
+
type: "offset",
|
|
125
|
+
id: "palm-sunday",
|
|
126
|
+
baseEvent: "easter",
|
|
127
|
+
offsetDays: -7,
|
|
128
|
+
title: "Palm Sunday",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: "offset",
|
|
132
|
+
id: "holy-thursday",
|
|
133
|
+
baseEvent: "easter",
|
|
134
|
+
offsetDays: -3,
|
|
135
|
+
title: "Holy Thursday",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
type: "offset",
|
|
139
|
+
id: "good-friday",
|
|
140
|
+
baseEvent: "easter",
|
|
141
|
+
offsetDays: -2,
|
|
142
|
+
title: "Good Friday",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: "offset",
|
|
146
|
+
id: "holy-saturday",
|
|
147
|
+
baseEvent: "easter",
|
|
148
|
+
offsetDays: -1,
|
|
149
|
+
title: "Holy Saturday",
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
// Easter Season
|
|
153
|
+
{
|
|
154
|
+
type: "offset",
|
|
155
|
+
id: "easter-monday",
|
|
156
|
+
baseEvent: "easter",
|
|
157
|
+
offsetDays: 1,
|
|
158
|
+
title: "Easter Monday",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
type: "offset",
|
|
162
|
+
id: "divine-mercy",
|
|
163
|
+
baseEvent: "easter",
|
|
164
|
+
offsetDays: 7,
|
|
165
|
+
title: "Divine Mercy Sunday",
|
|
166
|
+
},
|
|
167
|
+
{ type: "offset", id: "ascension", baseEvent: "easter", offsetDays: 39, title: "Ascension" },
|
|
168
|
+
{ type: "offset", id: "pentecost", baseEvent: "easter", offsetDays: 49, title: "Pentecost" },
|
|
169
|
+
|
|
170
|
+
// Ordinary Time
|
|
171
|
+
{ type: "offset", id: "trinity", baseEvent: "easter", offsetDays: 56, title: "Trinity Sunday" },
|
|
172
|
+
{
|
|
173
|
+
type: "offset",
|
|
174
|
+
id: "corpus-christi",
|
|
175
|
+
baseEvent: "easter",
|
|
176
|
+
offsetDays: 60,
|
|
177
|
+
title: "Corpus Christi",
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Easter Calculation
|
|
184
|
+
|
|
185
|
+
The plugin uses the Computus algorithm to calculate Easter dates:
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
import { computeEaster } from "calendaryjs-plugin-liturgical";
|
|
189
|
+
|
|
190
|
+
const easter2025 = computeEaster(2025);
|
|
191
|
+
// Returns: Date object for Easter Sunday 2025
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Related Packages
|
|
195
|
+
|
|
196
|
+
- [calendaryjs](https://github.com/calendaryjs/calendaryjs/tree/main/packages/calendaryjs) - Core package
|
|
197
|
+
- [calendaryjs-plugin-lunar](https://github.com/calendaryjs/calendaryjs/tree/main/packages/lunar) - Lunar calendar
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MIT
|