Girolabs / fathersApp

Schoenstatt Fathers social app
4 stars 2 forks source link

[calendar] Upgrade to date-tiles API version 2 to allow for empty tiles #248

Closed jroedel closed 1 year ago

jroedel commented 2 years ago

La API tiene una nueva versión de date-tiles que permite representar fechas que no tienen ningún evento.

Esto es necesario por lo siguiente: El día 21 de julio no tiene ningún cumpleaños ni ordenación para mostrar al usuario. Cuando un usuario carga la página principal, la primera fecha va a ser el 22 de julio. Muchos usuarios sienten que "se saltó un día" porque no se muestra nada. Otros no se dan cuenta y leen esos nombres en la oración comunitaria.

La API nueva es así (/en/api/v2/date-tiles):

{
    "status": "OK",
    "result": [
        {
            "date": "2022-07-21T00:00:00Z",
            "memorialEvents": []
        },
        {
            "date": "2022-07-22T00:00:00Z",
            "memorialEvents": [
                {
                    "kind": "event",
                    "date": "2022-07-22T00:00:00Z",
                    "dateType": "historyDate",
                    "yearsAgo": null,
                    "isImportant": false,
                    "entityId": 114,
                    "entityName": "Monthly celebration of St. Vincent Pallotti / 4th milestone",
                    "entityCountry": null,
                    "entityObject": {
                        "eventId": 114,
                        "title": "Monthly celebration of St. Vincent Pallotti / 4th milestone",
                        "eventDate": "1900-07-22T00:00:00Z",
                        "country": null,
                        "showYearlyOnCommunityCalendar": true,
                        "showAnniversaryText": false,
                        "repeatOnMovableLiturgicalFeastIdentifier": null,
                        "tags": [],
                        "updatedOn": "2020-10-07T00:00:00Z",
                        "updatedBy": 5,
                        "createdOn": "2020-10-07T00:00:00Z",
                        "createdBy": 5,
                        "eventDateSameYear": "1900-07-22T00:00:00Z"
                    },
                    "sort": 1.5,
                    "text": "Historical",
                    "yearsAgoText": "%s years ago",
                    "importantText": null,
                    "importantGlyph": null,
                    "showEmailButton": false
                }
            ]
        }
    ]
}

La antigua API as así (/en/api/v1/date-tiles):


{
    "status": "OK",
    "result": [
        [
            {
                "kind": "event",
                "date": "2022-07-22T00:00:00Z",
                "dateType": "historyDate",
                "yearsAgo": null,
                "isImportant": false,
                "entityId": 114,
                "entityName": "Monthly celebration of St. Vincent Pallotti / 4th milestone",
                "entityCountry": null,
                "entityObject": {
                    "eventId": 114,
                    "title": "Monthly celebration of St. Vincent Pallotti / 4th milestone",
                    "eventDate": "1900-07-22T00:00:00Z",
                    "country": null,
                    "showYearlyOnCommunityCalendar": true,
                    "showAnniversaryText": false,
                    "repeatOnMovableLiturgicalFeastIdentifier": null,
                    "tags": [],
                    "updatedOn": "2020-10-07T00:00:00Z",
                    "updatedBy": 5,
                    "createdOn": "2020-10-07T00:00:00Z",
                    "createdBy": 5,
                    "eventDateSameYear": "1900-07-22T00:00:00Z"
                },
                "sort": 1.5,
                "text": "Historical",
                "yearsAgoText": "%s years ago",
                "importantText": null,
                "importantGlyph": null,
                "showEmailButton": false
            }
        ]
    ]
}
jroedel commented 1 year ago

Confirmo que se está usando la nueva versión :+1: