Events & Feasts – Specific Number of Days



To get the Upcoming Syro Malabar Events, just call the URL with just two parameters – Date (added to the end of the URL), along with the Count of Days needed from the Date provided.

https://syrocalendar.tk/SyroMalabarCalendar/?Mode=JSON&Type=DailyEvents&Date=<Date>&Count=<int>

where you have to provide the Date in dd-mm-yyyy format., and an int Count value


Example URL Call

https://syrocalendar.tk/SyroMalabarCalendar/?Mode=JSON&Type=DailyEvents&Date=15-05-2021&Count=5



Result

You will receive a JSON array that contains the following info for each day:

FieldDetail
SeasonIDThe ID of the Liturgical Season (1-11)
TimeStampTime Stamp value for the Day
WeeksNumber_EngCurrent Seasonal Week Number in English Text
WeeksNumber_MalCurrent Seasonal Week Number in Malayalam Text
EventDateDate of an Event
EventTitle_MalEvent Name in Malayalam
EventTitle_EngEvent Name in English
LinkURLLink to an explaining Article about the Event

Example Code with Javascript


<div id="lblEvents"></div>

<!-- SYRO MALABAR LITURGICAL EVENTS -->
<script>
var getJSON = function(url, callback) {
    var xhr = new XMLHttpRequest();
    xhr.open('GET', url, true);
    xhr.responseType = 'json';    
    xhr.onload = function() {    
        var status = xhr.status;        
        if (status == 200) {
            callback(null, xhr.response);
        } else {
            callback(status);
        }
    };    
    xhr.send();
};
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();
today = dd + '-' + mm + '-' + yyyy;

getJSON('https://syrocalendar.tk/SyroMalabarCalendar/?Mode=JSON&Type=DailyEvents&Count=5&Date=' + today,  function(err, tmtm) {    
if (err != null) {
	console.error(err);
} else {
	// **Syro Malabar Calendar API. For more info, visit https://SyroCalendar.tk **
	
	var ContentEvents = "";
	var SimilarDates = "";
	var LineFlag = 0;
		
	tmtm.forEach((item) => {
	ContentEvents = ContentEvents + "<table><tr>";
		if(item.EventDate != null){
			if(item.EventDate.toUpperCase() != SimilarDates){
				ContentEvents = ContentEvents + "<td rowspan=\"2\"><h3><b>" +  item.EventDate.toUpperCase() + "</b></h3></td>" ;
				SimilarDates = item.EventDate.toUpperCase();
			}
			else{
				ContentEvents = ContentEvents + "<td rowspan=\"2\"><h3><b>" +  "</b></h3></td>" ;
				SimilarDates = item.EventDate.toUpperCase();
				LineFlag = 1;
			}
		}
		if(item.LinkURL != null){
			if(item.EventTitle_Mal != null)
				if(LineFlag == 1){
					ContentEvents = ContentEvents + "<td><a href=\"" + item.LinkURL + "\" title=\"Click to know more\" target=\"_blank\"><b>" + item.EventTitle_Mal + "</b> ℹ️</a></td></tr>" ;
					LineFlag = 0;
				}else{
					ContentEvents = ContentEvents + "<td><a href=\"" + item.LinkURL + "\" title=\"Click to know more\" target=\"_blank\"><b>" + item.EventTitle_Mal + "</b> ℹ️</a></td></tr>" ;
				}
			if(item.EventTitle_Eng != null)
				ContentEvents = ContentEvents + "<tr><td><a href=\"" + item.LinkURL + "\" title=\"Click to know more\" target=\"_blank\"><b>"  + item.EventTitle_Eng + "</b> ℹ️</a></td></tr>";

		}else{			
			if(item.EventTitle_Mal != null)
				if(LineFlag == 1){
					ContentEvents = ContentEvents + "<td><b>" + item.EventTitle_Mal + "</b></td></tr>" ;
					LineFlag = 0;
				}else{
					ContentEvents = ContentEvents + "<td><b>" + item.EventTitle_Mal + "</b></td></tr>" ;
				}
			if(item.EventTitle_Eng != null)
				ContentEvents = ContentEvents + "<tr><td><b>"  + item.EventTitle_Eng + "</b></td></tr>";
		}
		ContentEvents = ContentEvents + "</table>";
	});		
	document.getElementById("lblEvents").innerHTML = ContentEvents;
	}
});
</script>

Please don’t forget to provide a link to SyroCalendar.tk below the Widget you implemented. It could be as simple as
Powered by SyroCalendar