Skip to content

Commit

Permalink
Fix abs2greg example
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Oct 20, 2024
1 parent 61e7775 commit 81a698b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/greg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ export function greg2abs(date: Date): number {
* function would return only the date 13 November 2008.
* @param abs - R.D. number of days
* @example
* const hd = new HDate(15, 'Cheshvan', 5769);
* const date = hd.greg(); // 13 November 2008
* const abs = hebrew2abs(5769, months.CHESHVAN, 15);
* const date = abs2greg(abs); // 13 November 2008
* const year = date.getFullYear(); // 2008
* const monthNum = date.getMonth() + 1; // 11
* const day = date.getDate(); // 13
Expand Down
2 changes: 2 additions & 0 deletions src/hdate-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ function assertNumber(n: any, name: string) {
* @param year Hebrew year
* @param month Hebrew month
* @param day Hebrew date (1-30)
* @example
* const abs = hebrew2abs(5769, months.CHESHVAN, 15);
*/
export function hebrew2abs(year: number, month: number, day: number): number {
assertNumber(year, 'year');
Expand Down

0 comments on commit 81a698b

Please sign in to comment.