Comments (6)
@chacham2 , See JewishDate.forward(int field, int amount). For the zmanim that are directly tied to the GregorianCalendar just maintain a calendar and roll it, and set the GregorianCalendar AstronomicalCalendar.setCalendar(Calendar calendar). Please let me know if this addresses your question.
from zmanim.
I'm trying to understand how to use that. Maybe i can form simpler questions to get it straight in my own head:
-
If i instantiate ZmanimCalendar, it gives me zmanim for today. When it runs overnight and the computer clock changes, will the zmanim now be the next day, or do i need to reset it?
-
I want to find the parasha of the week for use with formatParsha(). However, that requires an instantiation of JewishCalendar set to this week's Shabbos. Starting with ZmanimCalendar, how do i get a JewishCalendar for the coming Shabbos. (The Shabbos may be in the following month, so i assume adding days is required.) Do i need to maintain the date separately and keep it in sync?
-
I want to display the day's daf. That requires formatDafYomiBavli() which requires JewishCalendar.getDafYomiBavli() which requires an instantiation of JewishCalendar. Similar to #2, starting with ZmanimCalendar, how do i get a JewishCalendar?
Or, am i approaching this entirely wrong?
from zmanim.
If i instantiate ZmanimCalendar, it gives me zmanim for today. When it runs overnight and the computer clock changes, will the zmanim now be the next day, or do i need to reset it?
No. The class is not time aware and nothing will change.
I want to find the parasha of the week for use with formatParsha(). However, that requires an instantiation of JewishCalendar set to this week's Shabbos. Starting with ZmanimCalendar, how do i get a JewishCalendar for the coming Shabbos. (The Shabbos may be in the following month, so i assume adding days is required.) Do i need to maintain the date separately and keep it in sync?
Jump to the next Shabbos. If getParsha()
returns a real parsha, good, if not, move forward 7 days and try again.
I want to display the day's daf. That requires formatDafYomiBavli() which requires JewishCalendar.getDafYomiBavli() which requires an instantiation of JewishCalendar. Similar to #2, starting with ZmanimCalendar, how do i get a JewishCalendar?
Use ZmanimCalendar.getCalendar().getCalendar()
for a reference to the GregorianCalendar
used by the ZmanimCalendar
. Pass this to JewishCalendar.setDate(Calendar calendar)
to set it there. At that point you can just get the daf. Ultimately you want to manage the calendar in one place, and you may as well do it in the ZmanimCalendar
by setting the GregorianCalendar
there.
Please let me know if this addressed your questions.
from zmanim.
Sorry, for the basic questions. I'm trying to have it all click so i get what the best approach is.
No. The class is not time aware and nothing will change.
Thank you. That answers that question.
Jump to the next Shabbos. If
getParsha()
returns a real parsha, good, if not, move forward 7 days and try again.
Wouldn't that always return nothing? I think i'd need to add one day at a time and check. Though, 6- JewishCalendar.getDayOfWeek()
ought to give me the right amount of days to add. My question is how to add them. One way would be to use JewishDate.forward()
, and then JewishCalendar.setDate(JewishDate.getLocalDate())
or something. I'm not quite sure. Though, at that point it seems easier to just use the system date directly via JewishCalendar.setGregorianDate
.
Ultimately you want to manage the calendar in one place, and you may as well do it in the ZmanimCalendar by setting the GregorianCalendar there.
This is so confusing. I just need four objects: ZmanimCalendar, JewishCalendar set to today and another set to the coming Shabbos, and JewishDate set to today. Maybe i can just reset when the day changes. That is, JewishDate.resetDate()
, JewishCalendar.resetDate()
, and Zemanim.setCalendar(JewishCalendar.getGregorianCalendar)
. For Shabbos, just maintain a local date in vb, and use JewishCalendar.setGregorianDate(year, month, date)
as shown above. I feel like i'm reinventing the wheel though.
Do you want typos reported? While looking at the documentation i found:
https://github.com/KosherJava/zmanim/blob/master/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishDate.java#L1331
one day t a time -> one day at a time
https://github.com/KosherJava/zmanim/blob/master/src/main/java/com/kosherjava/zmanim/ZmanimCalendar.java#L66
second edition published -> second edition, published
https://github.com/KosherJava/zmanim/blob/master/src/main/java/com/kosherjava/zmanim/ZmanimCalendar.java#L78
a degree based offset -> a degree-based offset (not sure about this one)
from zmanim.
@chacham2, there is now a getUpcomingParsha(). See 52e49 . Does this address your issue?
from zmanim.
Very likely does, thank you.
Fwiw, i am no longer working on the project though. After this, that, and the other, someone else took over the project and took another route. Regardless, this is a nice addition!
from zmanim.
Related Issues (20)
- More `JewishCalendar` Tefila Rules / Special Days HOT 14
- Bain Hashmashos Spelled Hasmoshos
- isYomTov()
- add special Shabbasos
- check for machar_rosh_chodesh accounts for wday? HOT 1
- go-zmanim
- Yerushami Daf Yomi Trasliterated name error in order HOT 1
- Wrong formatter used on test output - LOW priority HOT 2
- In getDafYomiYerushalmi() [LastMischta, LastMesechtahMaxDaf + 1] returned for Daf 1 of Meschtas after Brachos HOT 2
- Spelling ? Kilayim כלאיים
- Flaw in logic? HOT 2
- Why use StringBuffer instead of StringBuilder? HOT 5
- Why Tfila vs. Tfilah?
- Spelling errors
- Identifying a zman?
- Add Mizmor Lesoda to TefilaRules HOT 10
- Cannot translate the parsha from the new API HOT 1
- Shushan Purim Katan is misspelled in Hebrew HOT 4
- VBA and VB6 port - vbzmanim HOT 2
- `NullPointerException` in `HebrewDateFormatter.formatDayOfWeek` due to uninitialized `weekFormat` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zmanim.