Liturgical-Calendar / LiturgicalCalendarAPI

A PHP script / API endpoint that will generate the Roman Catholic liturgical calendar for any given year, calculating the mobile festivities and the precedence of solemnities, feasts, memorials...
Apache License 2.0
39 stars 10 forks source link

Output one celebration per day? #43

Closed jfacemyer closed 3 years ago

jfacemyer commented 3 years ago

I looked around a bit, but didn't see an option for changing output content, not giving the vigil information on Saturdays, or preferring a Saint's proper memorial over an optional BVM on Saturdays, and only give the BVM if there's nothing else? (e.g. output the highest ranking or a preferred type each day?)

I was thinking about digging in and looking at implementing this, possibly, but wanted to know if this exists or was desired or was in the works already.

JohnRDOrazio commented 3 years ago

Hi @jfacemyer , the main purpose of this API is to output the correct liturgical celebrations for each day in a given calendar year, either in the universal roman calendar or for a specific nation or even a specific diocese. If there is an optional memorial on any given day, it will be output alongside the weekday, because it's optional. So if for example a Mass app were to use this calendar, there would be a choice of using the liturgical texts for the optional memorial or for the weekday. So in cases like that, no there is no option to output only one result, because how would choose which result to output? They're both equally important. I decided to incorporate Vigils into the calendar because that is also an important liturgical calculation: when there are two solemnities next to each other, which one has precedence when it comes to vigil masses / first vespers / second vespers? This is again important for any Mass app or breviary app or diocesan liturgical calendar, because it will determine which liturgical texts should be used for first vespers / second vespers or which Mass should be celebrated. The Saturday memorial of the Blessed Virgin Mary should only appear where it is permitted. If you see it appearing where it is not permitted please let me know.

jfacemyer commented 3 years ago

Ok, I get that.

Does it mean you would not be interested in a parameter to filter output like this, if I wanted to work on that?

JohnRDOrazio commented 3 years ago

I believe that if anything this could be done in a client implementation. Changing it on the server output would in my opinion be confusing and would require creation of more parameters which would make the endpoint even more confusing. However it is not difficult to create filters in a client implementation. For example, to remove vigil masses, you can delete any items in the JSON object that contain the word "vigil" in the name of the celebration (if your client is using English). I suppose to make it even easier to do for any language, I could create a new property "isVigilMass" in the resulting JSON object to clearly identify Vigil Masses, so as to be able to target them and filter them out. In fact, celebrations that have Vigil Masses already have a property "hasVigilMass" set to true, for example:

"MotherGod":{"name":"Maria Ss.ma Madre di Dio","color":"white","type":"fixed","grade":6,"common":"","date":"1609459200","displaygrade":"","eventidx":44,"liturgicalyear":"ANNO B","hasVigilMass":true,"hasVesperI":true,"hasVesperII":true}

But being able to target the actual Vigil Mass event isn't quite so straightforward, without searching for the term "vigil" in the name of the celebration. That I can do.

JohnRDOrazio commented 3 years ago

I have added the isVigilMass property to better identify Vigil Masses:

Now it is very easy to target Vigil Mass events and filter them out from the results. I hope this fixes for you.

jfacemyer commented 3 years ago

Ok, thanks - I'll look at a client implementation!