jyotisham / jyotisha

Python tools for the astronomical / astrological vedAnga of Hindus
MIT License
88 stars 52 forks source link

All day events and event timings in ICS #93

Closed vvasuki closed 3 years ago

vvasuki commented 3 years ago

Continuing from https://github.com/jyotisham/jyotisha/commit/49b9973e0e628df8234629f5061123b065799a6d#commitcomment-45562144 :

Currently, in http://jyotisham.github.io/jyotisha/output/sahakAra-nagar-bengaLUru/MULTI_NEW_MOON_SIDEREAL_MONTH_ADHIKA__CHITRA_AT_180/gregorian/2000s/2020s/2021.ics , even though the event has:

END:VALARM
END:VEVENT
BEGIN:VEVENT
SUMMARY:आखुरथ-महागणपति सङ्कटहर-च
 तुर्थी-व्रतम्
DTSTART;VALUE=DATE:20210102
DTEND;VALUE=DATE:20210103

it does not show up in a couple of calendar apps. IIUC from the context, @karthikraman concludes that this is due to the presence of DTSTART value (which does not have time). So, solution is either to add the time, or to remove DTSTART and DTEND altogether.

It seems that @karthikraman has currently implemented the latter. But why was http://jyotisham.github.io/jyotisha/output/sahakAra-nagar-bengaLUru/MULTI_NEW_MOON_SIDEREAL_MONTH_ADHIKA__CHITRA_AT_180/gregorian/2000s/2020s/2021.ics not automatically regenerated with https://github.com/jyotisham/jyotisha/runs/1633528655?check_suite_focus=true ran??

How about using sunrise to sunrise time by default instead? (Though ideally we should look at timing field in the rule.)

karthikraman commented 3 years ago

What is the best practice for creating an all day event? Are the calendar apps buggy? I have no problem importing these into Google or Microsoft accounts...

vvasuki commented 3 years ago

What is the best practice for creating an all day event?

Greater and clearer info certainly helps, and I've observed that setting time in all-day events works well (see screenshots in thread linked earlier). We ought to set the all-day event to start with either sunrise time or aruNodaya time or midnight or moonrise as appropriate (currently working on beginning to do that).

Are the calendar apps buggy? I have no problem importing these into Google or Microsoft accounts...

I cannot import http://jyotisham.github.io/jyotisha/output/sahakAra-nagar-bengaLUru/MULTI_NEW_MOON_SIDEREAL_MONTH_ADHIKA__CHITRA_AT_180/gregorian/2000s/2020s/2021.ics to Google Calendar fruitfully. So, I'd concluded that Google Cal is buggy!

karthikraman commented 3 years ago

The reason to remove time was to truly mark the event as all-day, rather than a 24-hour event.

image

Here, you see that the event starts at 00:00 hours, which is OK, but weird. Putting intervals to the various festivals will end up greatly cluttering the calendar. It's just nice to have them all in the top. Hope this will be implemented as an option for the ICS, if at all... thanks!

I used to have DTSTART without time in the previous versions, and had no issues importing them into Google calendar.

vvasuki commented 3 years ago

The reason to remove time was to truly mark the event as all-day, rather than a 24-hour event.

image

This is some MS calendar app? The 0-s should be gone and replaced by sunrise times, mostly, I think - which is sensible. Check it out.

Putting intervals to the various festivals will end up greatly cluttering the calendar.

As in there will be long event rectangles squatting on the day in the calendar app? If so, I'm hoping not, thanks to https://github.com/jyotisham/jyotisha/blob/c669f5b260d6f4626084079d3966cf4104a209c3/jyotisha/panchaanga/writer/ics/festival_event.py#L122 .

It's just nice to have them all in the top.

Agreed - especially for events spanning most of the day rather than a small slice (like chandradarshanam or pradoShavrata). Is this not the case some how?

I used to have DTSTART without time in the previous versions, and had no issues importing them into Google calendar.

Hmm. Thanks for the info. I'm guessing it's something to do with day-summary events (I recall that removing those made importing work, back when I was fixing ics generation).

vvasuki commented 3 years ago

FWIW, I'm now seeing useful start-times for fests in Evolution calendar app (I needed to force "refresh", it seems).

image

karthikraman commented 3 years ago

This is cluttering up the TeX greatly. Not sure how to fix, because there are other puNyakAla events that span 24 hours (I was originally thinking of checking length and ignoring the interval if > 0.75 like you had used)...

image

This is totally amazing for chandra darshanam etc. though!

karthikraman commented 3 years ago

Could it be captured by a flag, instead of explicitly setting the interval as sunrise to sunrise?

karthikraman commented 3 years ago

image

Perhaps, there should be a way to disable this as an option... The all-day events are way nicer...

vvasuki commented 3 years ago

This is cluttering up the TeX greatly. Not sure how to fix, because there are other puNyakAla events that span 24 hours (I was originally thinking of checking length and ignoring the interval if > 0.75 like you had used)...

I'd anticipated this :-) Perhaps, we could reuse the method proposed in https://github.com/jyotisham/jyotisha/commit/c669f5b260d6f4626084079d3966cf4104a209c3#commitcomment-45577035 in both places?

vvasuki commented 3 years ago

Perhaps, there should be a way to disable this as an option... The all-day events are way nicer...

Oh - I see that your calendar client behaves differently (I don't get those ugly long rectangles here). Then, we should have an option in the ics generation function (the core calendar generation should continue to assign intervals). This option would switch off DTSTART for all_day events.

karthikraman commented 3 years ago

This is Google calendar :) Calendar client behaves ok... Instead of the "0" it shows a "6".

karthikraman commented 3 years ago

Chandra darshanam timings are sometimes off.. image

It should be calculated from sunset until moonset on the day assigned...

karthikraman commented 3 years ago

This example was on 2020-10-18

vvasuki commented 3 years ago

Chandra darshanam timings are sometimes off.. image

It should be calculated from sunset until moonset on the day assigned...

सूचनयोपकृतोऽहम्। प्रायेण समीकृतम् अधुना।

vvasuki commented 3 years ago

The fix forecloses the option of having times in all-day events (which I liked). But since that preference is not (yet) that strong, I acquiesce. (I was hoping that you would add an option as I'd suggested in one of the commit threads https://github.com/jyotisham/jyotisha/commit/c669f5b260d6f4626084079d3966cf4104a209c3#r45577843 .)