forrestguice / SuntimesWidget

Android app (and widget collection) that displays sunlight and moonlight times.
GNU General Public License v3.0
320 stars 59 forks source link

the moon day #345

Closed islam2hamy closed 1 year ago

islam2hamy commented 5 years ago

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

forrestguice commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 4 years ago

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 commented 4 years ago

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

location setting : latitude : 29.89195 longitude : 31.2916

forrestguice commented 4 years ago

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

islam2hamy commented 4 years ago

time zone setting : system time zone africa/cairo

gmt +2

forrestguice commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

forrestguice commented 4 years ago

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 commented 4 years ago

ok ,thank you for the illustration .

forrestguice commented 4 years ago

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 commented 4 years ago

yes you are right.

islam2hamy commented 4 years ago

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

islam2hamy commented 4 years ago

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 commented 2 years ago

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

islam2hamy commented 1 year ago

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

Thank you

forrestguice commented 1 year ago

@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 commented 1 year ago

@forrestguice thank you a lot