Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the moon day #345

Closed
islam2hamy opened this issue Jul 8, 2019 · 22 comments · Fixed by #686
Closed

the moon day #345

islam2hamy opened this issue Jul 8, 2019 · 22 comments · Fixed by #686
Labels
Milestone

Comments

@islam2hamy
Copy link

islam2hamy commented Jul 8, 2019

i need (1x1) widget show moon day - to know what is the day of the moon is .
(small islamic calendar , just the day)

@forrestguice
Copy link
Owner

forrestguice commented Jul 9, 2019

I'll have to learn more about this. I'm actually ignorant of the details. I'm currently reading https://www.timeanddate.com/calendar/islamic-calendar.html.

If I understand, day1 begins at moonrise of the waxing crescent (first visible sliver of moon). There are 29 days (or 30? add a day if the waxing crescent isn't yet visible). So the widget needs to show a number, 1-29, but the rules for choosing that number are maybe not so simple.

In a general sense I can see this feature being within the app's scope as a "date widget", a 1x1 widget that displays just the day, and then has an option to choose the calendar (small islamic, gregorian, etc). ..but I am also wary of being "off by 1" - I don't want the widget to get it wrong, especially if there's a possibility that someone might take offense.

The app might rely on a library to just report the day (I bet Time4J has this covered), but I really want to avoid integrating with any particular library (or calendar system) too deeply - a method would have to be added to the "calculator interface" (limited). Implementing the rules directly within the widget is also possible, especially if being off-by-one is no big deal.

@forrestguice
Copy link
Owner

I'll have to give this some thought. I don't think a "date widget" or a "moon day" widget will be in the next release, v0.12.0 (which I'm trying to find time to finish up, hopefully before August), but maybe after that.

@islam2hamy
Copy link
Author

take your time ,

"I don't want the widget to get it wrong, especially if there's a possibility that someone might take offense."

alot of apps and also the printed calendar some times get it wrong , as u can see in the site you refer "Difficult to Predict
The traditional version of the Islamic calendar requires an authorized person or committee to make an actual sighting of the Crescent Moon to determine the length of each month." for that apps make an option to manual change the day with +1 or 2 or 3 , -1or 2 or3 .

however , take your time and do your best .

@islam2hamy
Copy link
Author

just to let you know , after using the app for all this period , the new moon in the app till now is the same as the actual sighting of the Crescent .

@islam2hamy
Copy link
Author

Hmmm, the app say tomorrow is 14 , it is actually today not tomorrow.

location setting :
latitude : 29.89195
longitude : 31.2916

@forrestguice
Copy link
Owner

What is the time zone set to?
The location setting is only used here if set to solar time.

@islam2hamy
Copy link
Author

islam2hamy commented Sep 13, 2019

time zone setting : system time zone
africa/cairo

gmt +2

@forrestguice
Copy link
Owner

It looks right to me. The current time for gmt+2 is Sept 14, 4:45AM, so 8 hours ago (at time posted) the date was Sept 13 (and tomorrow the 14th).

@islam2hamy
Copy link
Author

it say Sept 14, 6:32:56 AM , however the time is not the issue it is the day , if i am not wrong the app tell me the day that in it's night that i will see the phase , am i wrong ?

and when i looked to the moon on 13 sep. it was full , and that is what the islamic calender say 13 sep = the day n. 14 of the moon , and it was at the night.

may be i misunderstanding something ?

@forrestguice
Copy link
Owner

forrestguice commented Sep 14, 2019

I'm not sure I understand - I thought you were referring to the "Today" / "Tomorrow" labels in the main table. The app displays the date using the Gregorian Calendar, so the transition between one day and the next occurs at midnight - it was the 13th when this was posted.

The major moon phases are all instants - they occur at exact times (and not necessary at night). When the phase is displayed in the main table its for the the entire day (to mimic a paper calendar). It doesn't necessarily mean it will be a full moon that night, but rather that a full moon occurs sometime during the calendar day (and may have even already occurred).

The last full moon was at UTC Sept 14, 4:32 AM, so for time zones west of GMT this is going to be labeled the 13th.

@forrestguice
Copy link
Owner

hrm, I think its a misunderstanding. The main table displayed a full moon occurring "tomorrow" on the 14th, but you were expecting to see a full moon for "today" on the 13th, but technically speaking, this last full moon occurred early morning on 14th.

You are right to anticipate observing a full moon on the night of the 13th, but the main table in the app doesn't work that way. The moon dialog is more accurate in this regard - the main table says the full moon is on the 14th, but the moon dialog says this was actually ~11 hours ago.

@islam2hamy
Copy link
Author

Hmm, if we ignored the real time calculation and depending only on the day , is it will be 13th ??

@forrestguice
Copy link
Owner

forrestguice commented Sep 14, 2019

Well it depends on the time zone. The full moon is an instant in time - it actually occurs at an exact moment. This month that exact moment is around 4AM UTC on the 14th (so for all time zones GMT-4 westward the date displayed will be the 13th).

..but its not wrong to say the full moon will occur on the night of the 13th.. it occurs 4 hours after midnight (technically the 14th). The app doesn't work the way you described though - its not "the day that in its night" you'll be able to observe the phase, its only the date on which you'll be able to observe the phase.

@islam2hamy
Copy link
Author

ok ,thank you for the illustration .

@forrestguice
Copy link
Owner

I think from an observers view there really isn't a discernible difference between a full moon and waxing or waning gibbous that is 100% - they all appear "full", so I think its really common to say things like "its a full moon today", and to be referring to the entire day (and not some moment that occurs on that day).

@islam2hamy
Copy link
Author

yes you are right.

@islam2hamy
Copy link
Author

Hmm , today 29/9/2019 is the day n. 30 for the moon , not n.1

@islam2hamy
Copy link
Author

i know that i'm talking a lot about this point (the moon day) , but i hope that my feedback help in creating that feature .

@islam2hamy
Copy link
Author

If new moon time < sunset time , so the day of the new moon is 1

If new moon time > sunset time , so the day of the new moon is not 1

Ex. :
new moon time 4 pm
sunset time 5 pm
So new moon day is day number 1

Hope this is the approximate equation for this widget
With a user ability to +1 or -1

@forrestguice forrestguice added this to the v0.15.0 milestone Apr 6, 2022
@forrestguice forrestguice mentioned this issue May 14, 2022
forrestguice added a commit that referenced this issue Nov 11, 2022
adds "moon day" 1x1 widget layout (#345)
forrestguice added a commit that referenced this issue Nov 11, 2022
adds 'date offset' widget pref (#345)
forrestguice added a commit that referenced this issue Nov 11, 2022
implemented with Time4J calendar api (#345)
@forrestguice forrestguice mentioned this issue Jan 17, 2023
@islam2hamy
Copy link
Author

Hello @forrestguice
Please note that my request is about the moon phases not iran calander

Thank you

@forrestguice
Copy link
Owner

forrestguice commented Feb 1, 2023

@islam2hamy Both features have been added actually. The "Moon day" is available from the 1x1 moon widget (as an alternate layout). This also provides the requested offset setting (+/- days). The widget is backed by http://time4j.net/javadoc-en/net/time4j/calendar/HijriCalendar.html

It's not the same as the new "date widget", which allows choosing between different calendars (including the Iranian calendar). These are provided by the Time4J API (e.g. http://www.time4j.net/javadoc-en/net/time4j/calendar/PersianCalendar.html).

@islam2hamy
Copy link
Author

@forrestguice thank you a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants