Hi,
For those interested in below issue solving :
1/ Create an empty personnal “birthday calendar” into Google Agenda (remind the ID of the calendar into calendar parameters for later)
2/ Create a new google script which you can store into your Google drive
3/ Paste below code into the script :
function Sync_Birth_Cal() {
// Calendars adress (ID)
var calendarSource = CalendarApp.getCalendarById("THE ID OF YOUR CONTACT CALENDAR");
var calendarDestination = CalendarApp.getCalendarById("THE ID OF THE CREATED CALENDAR");
// Start and End Date definition
var Today = new Date();
var StartDeleteDate = new Date();
var EndDeleteDate = new Date();
var StartCopyDate = new Date();
var EndCopyDate = new Date();
StartDeleteDate.setDate(Today.getDate()-400);
EndDeleteDate.setDate(Today.getDate()+400);
StartCopyDate.setDate(Today.getDate()-360);
EndCopyDate.setDate(Today.getDate()+360);
// first deletes all datas in calendar
var eventToDelete = calendarDestination.getEvents(StartDeleteDate, EndDeleteDate);
for (var i = 0; i < eventToDelete.length; i++) {
eventToDelete[i].deleteEvent();
}
// then copy everything again
var eventToCopy = calendarSource.getEvents(StartCopyDate, EndCopyDate);
for (var t in eventToCopy){
var newEvent = calendarDestination.createEvent(eventToCopy[t].getTitle(), eventToCopy[t].getStartTime(), eventToCopy[t].getEndTime());
}
}
4/ Into Google script, Edit, Add trigger (choose the one you want, I personally choose to launch that one every 2 hours, but you can do whatever you want)
5/ You can know use the .ics path of the newly created calendar into your MM calendar
NOTE : it’s the first time I write that kind of stuff. It works for me until now, but there could be some bugs also. Let’s see.
NOTE 2 : be careful… part of the script is deleting calendars events on purpose… So don’t mess up…If needed, back up before.
Regards