JSRunnels Posted December 23, 2004 Posted December 23, 2004 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
comment Posted December 23, 2004 Posted December 23, 2004 Interesting method - haven't seen this one before. At first glance, it shouldn't be too hard to implement in FMP. It will, however run out in 15 years...
JSRunnels Posted December 26, 2004 Author Posted December 26, 2004 Can't I deal with that problem 14 years from now...?
comment Posted December 26, 2004 Posted December 26, 2004 Aren't those the exact words that begat Y2K?
-Queue- Posted December 28, 2004 Posted December 28, 2004 I'm working on this. I'll post again when I've made some progress.
comment Posted December 28, 2004 Posted December 28, 2004 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
JSRunnels Posted December 28, 2004 Author Posted December 28, 2004 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! Anyway, thank you so much. I am going to try to incoporate it into my database now.
comment Posted December 28, 2004 Posted December 28, 2004 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.
JSRunnels Posted December 28, 2004 Author Posted December 28, 2004 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!
JSRunnels Posted December 28, 2004 Author Posted December 28, 2004 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.
Fenton Posted December 29, 2004 Posted December 29, 2004 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.
-Queue- Posted December 29, 2004 Posted December 29, 2004 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...
comment Posted December 29, 2004 Posted December 29, 2004 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!
-Queue- Posted December 29, 2004 Posted December 29, 2004 They are located here. I'll be sure to test the results against your file and other calendars. I think some custom functions would be easier to create than this scripted version is.
comment Posted December 29, 2004 Posted December 29, 2004 I see that they are credited to here . As for testing, I don't know: of the 3 epochs, FMP7 is the shortest, spanning 1,460,970 days. What level of confidence can one expect from random testing? "For example, the United States Naval Observatory
-Queue- Posted December 29, 2004 Posted December 29, 2004 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.
comment Posted December 29, 2004 Posted December 29, 2004 Right. Sloppy work, as always. While at it, I have converted it to a single v.7 file and added some minor simplifications. Weizman.zip
-Queue- Posted December 29, 2004 Posted December 29, 2004 Okay, here's the first draft. I know it can be simplified, but it's not easy to be efficient when converting from JavaScript. I'll work on cleaning it up later. For now, I'm going to watch a movie. Calendar.zip
comment Posted December 29, 2004 Posted December 29, 2004 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.
-Queue- Posted December 29, 2004 Posted December 29, 2004 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.
-Queue- Posted December 30, 2004 Posted December 30, 2004 Okay, here's a new version with a few simplifications. I haven't made it to changing the way the month is set yet, but I'll work on it. Calendarv2.zip
comment Posted December 30, 2004 Posted December 30, 2004 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.
comment Posted December 30, 2004 Posted December 30, 2004 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
-Queue- Posted December 30, 2004 Posted December 30, 2004 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.
JSRunnels Posted December 30, 2004 Author Posted December 30, 2004 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...
comment Posted December 30, 2004 Posted December 30, 2004 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? 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
-Queue- Posted December 30, 2004 Posted December 30, 2004 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. 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. Oh, and to JS, you'll be the first to know if and when we develop a successful solution.
comment Posted December 31, 2004 Posted December 31, 2004 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
comment Posted January 4, 2005 Posted January 4, 2005 I am still too busy to continue, but I have just received this and thought you'd like to have it too. The password is in your PM. passinpm.zip
comment Posted January 4, 2005 Posted January 4, 2005 And of course I couldn't resist, so here it is. LOOK MA, NO SCRIPT! DershowitzNew.zip
JSRunnels Posted January 4, 2005 Author Posted January 4, 2005 comment, It is very, very cool. May I use it in my database? Jessica
comment Posted January 8, 2005 Posted January 8, 2005 Sorry for not responding earlier. You can use it, provided you keep the credits. I am, however, working on an improved version, which will greatly simplify the business with the months naming. I just can't find the time right now to finish it.
-Queue- Posted January 10, 2005 Posted January 10, 2005 Awesome! Sorry I haven't been around to help with this. I was out with strep AND the flu last week. Excellent work though, you should receive a medal.
QuinTech Posted January 10, 2005 Posted January 10, 2005 And back with a vengeance! Give that keyboard some time to rest, JT!
-Queue- Posted January 11, 2005 Posted January 11, 2005 I had to last night due to a gig, and tonight I have band practice. So you'll be sure to get your turn again.
Recommended Posts
This topic is 1633 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 accountSign in
Already have an account? Sign in here.
Sign In Now