Your comments

Michael, I will work on fixing the dates. I'll probably reach out separately to understand how to run the code locally for testing.

But what about the years? 1 Tishri 1 should start in Gregorian -3761

When I convert 1 Tishri 1 to Gregorian, I get Mon, 7 September 3760 B.C.E.
Whether this is correct or not depends on how you count years.
If you count from Adam then it should be a Friday.

If you count from Creation then 1 Tishri of year 2 should be a Friday but the converter returns Sat, 28 August 3759 B.C.E..

If we look at years:

- year 5783 starts in 2022

- year 3762 starts in year 1 (5783 - 2021)

- year 3761 starts in year -1 (there was no 0)

- year 1 starts in -3761 (-1 - 3760)

We can look at it from the Gregorian side:

- year 2022 has rosh hashana of 5783

- year 1 has rosh hashana of 5783 - 2021 = 3762

- year -1 has rosh hashana of 3762 - 1 = 3761

- to know when was rosh hashana of year 1: -1 - 3760 = -3761 

or just run this python:

g = 2022
for h in reversed(range(1, 5784)):
if g in [-1, 0, 1, 2022] or h == 1:
print(f"{g} - {h}")
g = g - 1
if g == 0: g = -1

Therefore I think Hebcal is a bug

The question is which Hebrew year is year 1.
As far as I know, and as also written in Wikipedia here, when we count from the creation of the world (beriat haolam), the world was created on 25 Elul year 1 and the first Rosh Hashana on 1 Tishri was year 2.

There was no 1 Tishri 1.

Is this a bug in Hebcal or you do not count from the creation of the world?