Skip to content

Commit f476e43

Browse files
committed
port Sedra from JS to TS
1 parent f90046a commit f476e43

7 files changed

+1194
-6
lines changed

README.md

+119
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ holidays. <code>@hebcal/hdate</code> supports four locales by default</p>
3333
<li><code>he-x-NoNikud</code> - Hebrew without nikud (e.g. &quot;שבת&quot;)</li>
3434
</ul>
3535
</dd>
36+
<dt><a href="#Sedra">Sedra</a></dt>
37+
<dd><p>Represents Parashah HaShavua for an entire Hebrew year</p>
38+
</dd>
3639
</dl>
3740

3841
## Members
@@ -41,6 +44,10 @@ holidays. <code>@hebcal/hdate</code> supports four locales by default</p>
4144
<dt><a href="#greg">greg</a></dt>
4245
<dd><p>Gregorian date helper functions.</p>
4346
</dd>
47+
<dt><a href="#parshiot">parshiot</a> : <code>Array.&lt;string&gt;</code></dt>
48+
<dd><p>The 54 parshiyot of the Torah as transilterated strings
49+
parshiot[0] == &#39;Bereshit&#39;, parshiot[1] == &#39;Noach&#39;, parshiot[52] == &quot;Ha&#39;azinu&quot;.</p>
50+
</dd>
4451
</dl>
4552

4653
## Functions
@@ -846,12 +853,124 @@ Removes nekudot from Hebrew string
846853
| --- | --- |
847854
| str | <code>string</code> |
848855

856+
<a name="Sedra"></a>
857+
858+
## Sedra
859+
Represents Parashah HaShavua for an entire Hebrew year
860+
861+
**Kind**: global class
862+
863+
* [Sedra](#Sedra)
864+
* [new Sedra(hyear, il)](#new_Sedra_new)
865+
* [.get(hd)](#Sedra+get) ⇒ <code>Array.&lt;string&gt;</code>
866+
* [.getString(hd, [locale])](#Sedra+getString) ⇒ <code>string</code>
867+
* [.isParsha(hd)](#Sedra+isParsha) ⇒ <code>boolean</code>
868+
* [.find(parsha)](#Sedra+find)[<code>HDate</code>](#HDate) \| <code>null</code>
869+
* [.getSedraArray()](#Sedra+getSedraArray) ⇒ <code>Array.&lt;NumberOrString&gt;</code>
870+
* [.getFirstSaturday()](#Sedra+getFirstSaturday) ⇒ <code>number</code>
871+
* [.getYear()](#Sedra+getYear) ⇒ <code>number</code>
872+
* [.lookup(hd)](#Sedra+lookup) ⇒ <code>SedraResult</code>
873+
874+
<a name="new_Sedra_new"></a>
875+
876+
### new Sedra(hyear, il)
877+
Caculates the Parashah HaShavua for an entire Hebrew year
878+
879+
880+
| Param | Type | Description |
881+
| --- | --- | --- |
882+
| hyear | <code>number</code> | Hebrew year (e.g. 5749) |
883+
| il | <code>boolean</code> | Use Israel sedra schedule (false for Diaspora) |
884+
885+
<a name="Sedra+get"></a>
886+
887+
### sedra.get(hd) ⇒ <code>Array.&lt;string&gt;</code>
888+
Returns the parsha (or parshiyot) read on Hebrew date
889+
890+
**Kind**: instance method of [<code>Sedra</code>](#Sedra)
891+
892+
| Param | Type | Description |
893+
| --- | --- | --- |
894+
| hd | [<code>HDate</code>](#HDate) \| <code>number</code> | Hebrew date or R.D. days |
895+
896+
<a name="Sedra+getString"></a>
897+
898+
### sedra.getString(hd, [locale]) ⇒ <code>string</code>
899+
Looks up parsha for the date, then returns a translated or transliterated string
900+
901+
**Kind**: instance method of [<code>Sedra</code>](#Sedra)
902+
903+
| Param | Type | Description |
904+
| --- | --- | --- |
905+
| hd | [<code>HDate</code>](#HDate) \| <code>number</code> | Hebrew date or R.D. days |
906+
| [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale |
907+
908+
<a name="Sedra+isParsha"></a>
909+
910+
### sedra.isParsha(hd) ⇒ <code>boolean</code>
911+
Checks to see if this day would be a regular parasha HaShavua
912+
Torah reading or special holiday reading
913+
914+
**Kind**: instance method of [<code>Sedra</code>](#Sedra)
915+
916+
| Param | Type | Description |
917+
| --- | --- | --- |
918+
| hd | [<code>HDate</code>](#HDate) \| <code>number</code> | Hebrew date or R.D. days |
919+
920+
<a name="Sedra+find"></a>
921+
922+
### sedra.find(parsha) ⇒ [<code>HDate</code>](#HDate) \| <code>null</code>
923+
Returns the date that a parsha occurs
924+
or `null` if the parsha doesn't occur this year
925+
926+
**Kind**: instance method of [<code>Sedra</code>](#Sedra)
927+
928+
| Param | Type |
929+
| --- | --- |
930+
| parsha | <code>number</code> \| <code>string</code> \| <code>Array.&lt;string&gt;</code> |
931+
932+
<a name="Sedra+getSedraArray"></a>
933+
934+
### sedra.getSedraArray() ⇒ <code>Array.&lt;NumberOrString&gt;</code>
935+
Returns the underlying annual sedra schedule.
936+
Used by `@hebcal/triennial`
937+
938+
**Kind**: instance method of [<code>Sedra</code>](#Sedra)
939+
<a name="Sedra+getFirstSaturday"></a>
940+
941+
### sedra.getFirstSaturday() ⇒ <code>number</code>
942+
R.D. date of the first Saturday on or after Rosh Hashana
943+
944+
**Kind**: instance method of [<code>Sedra</code>](#Sedra)
945+
<a name="Sedra+getYear"></a>
946+
947+
### sedra.getYear() ⇒ <code>number</code>
948+
**Kind**: instance method of [<code>Sedra</code>](#Sedra)
949+
<a name="Sedra+lookup"></a>
950+
951+
### sedra.lookup(hd) ⇒ <code>SedraResult</code>
952+
Returns an object describing the parsha on the first Saturday on or after `hd`
953+
954+
**Kind**: instance method of [<code>Sedra</code>](#Sedra)
955+
956+
| Param | Type | Description |
957+
| --- | --- | --- |
958+
| hd | [<code>HDate</code>](#HDate) \| <code>number</code> | Hebrew date or R.D. days |
959+
849960
<a name="greg"></a>
850961

851962
## greg
852963
Gregorian date helper functions.
853964

854965
**Kind**: global variable
966+
<a name="parshiot"></a>
967+
968+
## parshiot : <code>Array.&lt;string&gt;</code>
969+
The 54 parshiyot of the Torah as transilterated strings
970+
parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[52] == "Ha'azinu".
971+
972+
**Kind**: global variable
973+
**Read only**: true
855974
<a name="months"></a>
856975

857976
## months : <code>enum</code>

package-lock.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hebcal/hdate",
3-
"version": "0.9.9",
3+
"version": "0.9.10",
44
"description": "converts between Hebrew and Gregorian dates using Rata Die (R.D.) algorithm by Dershowitz and Reingold",
55
"author": "Michael J. Radwin (https://github.com/mjradwin)",
66
"contributors": [

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export * from './molad';
77
export * from './dateFormat';
88
export * from './locale';
99
export {HDate} from './hdate';
10+
export * from './sedra';

0 commit comments

Comments
 (0)