Jump to content
Server Maintenance This Week. ×

Hebrew Calendar


JSRunnels

This topic is 1366 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Anybody out there made a set of calculations to convert from the Julian calendar to the Hebrew calendar...? I am making a database to manage my synagogue's member database, and it would be oh so cool if you could just plug in the Julian date and out pops the Hebrew date. Many programs/websites will do this for you, but I would like to have it be part of the database. If anyone is interested in a complex conversion problem, I have attached a one page document that explains the conversion...

UltimateJewishCalendarV2ENG.pdf

Link to comment
Share on other sites

I have already done it, but there's a matter of copyright to consider. I am attaching this strictly under Fair Use, for learning purposes only.

This is in v.4, I trust the conversion will be smooth.

It is still a bit awkward, but I don't know if it can be made more elegant, as the underlying method was specifically designed for humans, not for computers.

P.S. If you want a real challenge, try doing the proper conversion, one that will work perpetually. I have the algorithms, but the amount of iterations is making my head spin.

Weizman.zip

Link to comment
Share on other sites

Very cool, Comment. I got the original .pdf on the internet from the creator -- http://www.lamed.fr/calendar/ He seemed to be putting it out there for anyone to use.

Now all it needs is a field to ask if the "event" you are calculating for (birth/death) occured before or after sunset. (The Hebrew calendar begins at sunset the day before...) So if the birth occured at night, it is actually the next day...

One question -- why all the seperate tables? Wouldn't it be easier to put them all in the same database? Maybe that is not available in v.4 (I am just starting with FMP7, so I don't know what previous versions will and will not allow...)

I don't even want to think about the proper conversion, I can barely handle the paper one with lots of concentration and mumbling to myself! wink.gif

Anyway, thank you so much. I am going to try to incoporate it into my database now.

Link to comment
Share on other sites

I got the original .pdf on the internet from the creator -- http://www.lamed.fr/calendar/ He seemed to be putting it out there for anyone to use.

To use, yes. To copy, no. There's an express copyright notice on the document. I presume he would gladly grant you his permission, but you should definitively ask him before you use this.

why all the seperate tables? Wouldn't it be easier to put them all in the same database?

In v.4, each table is a separate file.

I don't even want to think about the proper conversion, I can barely handle the paper one with lots of concentration

How do you do a paper conversion? If you know a step-by-step method for doing this "in longhand", I'd love to have it.

Link to comment
Share on other sites

How do you do a paper conversion? If you know a step-by-step method for doing this "in longhand", I'd love to have it.

I meant the "paper" pdf that I uploaded.

I will be sure to ask for copyright permission if I get it up and running in the database.

Thanks for figuring it out. I haven't dissected it yet, but it was beyond me for sure!

Link to comment
Share on other sites

P.S. If you are interested in seeing the database I am creating that this will go into, there are about a hundred sequential copies of it in the Finding forum under "Having trouble with constrain Find." Fenton has been amazingly helpful to me and helped me take the database from "Good Beginner Effort" to "Super Slick" (IMHO).

I am nearing completion and would like to have this function built in for calculating yahrzeits, etc.

Link to comment
Share on other sites

I converted that calendar to 7. It works. Just drop all the files on 7 at once. You will still have 3 files. If you own FM Robot and are on a PC, you could merge them into one. You could also fairly easily recreate the files as 3 tables in 7 (recreate 2 of them). They are not that big or complex (to copy anyway), but they are rather geeky and tedious.

Link to comment
Share on other sites

Well, that's what I get for having the flu all day. I haven't been coherent enough since last night to work on this. Nice job, comment!

I'm still taking on the challenge of porting an algorithm from JavaScript though. I think I was halfway there before I got knocked into fever land. Wish me luck...

Link to comment
Share on other sites

What algorithms are you sourcing? Beware, not all the algorithms on the web are strictly correct. The undisputed masters are Reingold & Dershowitz. I have their C++ code (in public domain). Ideally this could be used to make a plugin, unfortunately I haven't got a clue how to go about that.

If you want to make a set of custom functions, perhaps this VB code would make a convenient starting point.

Wishing you luck and full recovery!

Link to comment
Share on other sites

Interesting. Well, I'll do what I can.

I just noticed that either your Sum needs to be a number or HebDate needs to include GetAsNumber(Sum). Otherwise, the year sometimes comes out incorrectly.

Link to comment
Share on other sites

Ok, first of all, like, wow! Or perhaps buzzzzzzz (the sound of your calcs going over my head). I thought it would look more comprehensible when ported to FMP - right now, I think I have a better chance understanding the VB code I mentioned earlier than yours.

Two points off the bat (and probably the last, since I don't think I will penetrate any deeper):

Since FMP keeps its dates as serial numbers to begin with, you can make the calculation of cJDNconv =

GetAsNumber ( dGreg ) + 1373428

I think the month should be computed first as a number, then Choose() the name; this will allow for spelling adjustments.

Link to comment
Share on other sites

I think the most confusing aspect is probably the bitwise AND and OR calculations, which would be greatly simplified using custom functions. I'll work on commenting the scripts later to hopefully make more sense.

Nice call on the JDN calc, but I must say I'm a bit stymied at the moment. Perhaps it's the result of too much flu medicine, but how did you come to that conclusion? I knew it could be simplified since it was almost directly pulled from JavaScript, but I didn't think it could go THAT far. Oh, you would need to add + AfterSunset to your calc to account for the Day(dGreg) + AfterSunset portion of mine.

There was a field to hold the month number originally, but I removed it because it wasn't used for any of the calculations. I think I would probably add it back in and change the month name to reference a global field containing a list of the months, which could easily be changed to produce the desired spelling.

I'll do some more tweaking and post more later.

Link to comment
Share on other sites

I have started another approach here (got inspired), which I think is simpler than yours. I made custom functions for everything, until I got to the final part.

I can now determine the year via a script, and I think(!) I will be able to calculate the month and the day, after that. It's setting the year that's the real killer.

I will look at your progress later (dead tired now).

Regarding the sunset, I wouldn't bother much with it. It's a very easy add-on, if needed: just make your anchor date (dGreg) a calc = InputDate + AfterSunset.

Link to comment
Share on other sites

OK, seen it. The biq question, IMHO, is this: Can it be done without a script?

(The next question, I think, will be: SHOULD it be done without a script?)

I am stuck with the iterations, even more than I thought. Am I correct in assuming that in order to loop a CF, only one of its defined parameters can be the index? I can't find a way to get around that.

If it must be scripted, then all the CFs I have made are toast.

Anyway, I am attaching my current status. Note that the day is wrong - haven't hunted it down yet. But the algorithm seems simpler. Or is it just an optical illusion?

dershowitz.zip

Link to comment
Share on other sites

It does indeed seem to be simpler. I'll have to wrap my head around the calcs for a while though. I'm assuming you have access to the actual algorithm, which puts me at a disadvantage. Is there any chance I could get a copy of it, if you have it available in an electronic format?

I like the idea of using CFs, but I was going the scripted route originally because the poster didn't appear to have Developer. I think it should be made available both ways. I'll keep working on mine, if you want to keep working on yours. I might borrow some of your ideas also, since my resource was apparently not too keen on making the JavaScript efficient.

Can you elaborate on your recursive CF problem? Which one(s) in your file aren't working as expected?

If you would like to contact me off-list, PM me and we can work on this privately instead of making a 20-page thread on something most others wouldn't care about. wink.gif

Link to comment
Share on other sites

I do not, in fact, have developer. I have found myself lurking on "my" own thread, because I seem to have nothing useful to add. You two have confirmed that I posted to the right area!

I certainly understand if you take your discussion offline and I won't even pretend to follow most of what you are actually saying/doing, but I do care...

Link to comment
Share on other sites

I'm assuming you have access to the actual algorithm, which puts me at a disadvantage. Is there any chance I could get a copy of it, if you have it available in an electronic format?

I said earlier that I have the algorithms (In fact, I may have too many of them...). I will be glad for you to have them. I tried to hint that some are better than others, but I couldn't force them on you, could I?

Wave.gif

Read the contents first.

Can you elaborate on your recursive CF problem? Which one(s) in your file aren't working as expected?

The ones that aren't there, and are replaced by a script.

Take the Adjust MonthH script, for example. I made the @LastDayOfHebrewMonthCompound() function specifically for this problem (you won't find this one in any of the algorithms), I was sure I could find a way to compare the compound with LeftOverDays. Afer all, it's just a lookup. But no, couldn't make it. I'm beginning to think that perhaps a repeating field is more versatile than a CF.

Now I have the problem of spending too much time on this enjoyable addiction, at the expense of other pressing tasks. Could we we put this aside for a while, and convene back in 2 or 3 weeks time?

The poster is taken care of until 2020...

--- EDIT ---

If by "the actual algorithm" you meant a "recipe" for pencil and calculator - no, I don't. There's one in the attachment, but I don't trust that one too much. I did, however, ask someone to borrow the definite book for me, and hopefully it will have one. All the more reason to pause for now.

algorithms.zip

Link to comment
Share on other sites

That's fine with me. My doctor just ordered me to take a week off work and rest. So I'll be poring over your attachments when I'm bored out of my skull. wink.gif

Repeating fields versus Custom Functions -- now there's a debate I won't get into...seriously though, before the advent of 7, repeating fields were often the best solution. They're even better in 7 with the enhancements FMI has added. But even I would question whether they are more versatile than CFs. It would be an interesting study, nonetheless.

I, too, have been bitten by the algo-bug. This is a very intriguing and addictive task. Are there any Jewish calendar or date conversion FileMaker dbs in existence as far as you know? It would be cool if we created the first. wink.gif

Oh, and to JS, you'll be the first to know if and when we develop a successful solution. smile.gif

Link to comment
Share on other sites

Repeating fields versus Custom Functions

All I meant is that with the new Repeaters, you can use Get(CalculationRepetitionNumber) as a counter in a loop. I don't see a way to use a counter in CF, unless it is one of the function's parameters. To me, that is very limiting. What else do I need a CF for?

Case in point, I have eliminated all the CFs in my file, and replaced them with cascading calculation fields. Significantly faster now. I couldn't make the two required loops in a CF anyway, so they are scripted.

This could probably be optimized some more, but I like the way it shows what's being done. I hope it's bug-free now.

I look forward to talking to you again sometimes in the next year - have a happy one!

dershowitzCalc.zip

Link to comment
Share on other sites

This topic is 1366 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.