Hi I recently made an add-in that displays the upcomming employees's birthday of the company, at the begin all was good, but I don't know why when the people enters for the very fist time of the day the images are not displayed.
This seems be solved by entering to delve and then comeback.
For this I'm using REST API search, like so:
var birthday = 'Birthday01';
var space = '%20';
var colon = '%3A';
var quote = '%22';
var gt = '%3E';
var lt = '%3C';
var amp = '&';
// Get current date
var currentTime = new Date();
var startMonth = currentTime.getMonth() + 1;
var day = currentTime.getDate();
// Get current date + 30
var endTime = new Date();
var endTime = currentTime.AddDays(30);
var endMonth = endTime.getMonth() + 1;
var endDay = endTime.getDate();
var querytext = "";
// build query with the magic 2000 year
if (startMonth != '12') {
querytext += birthday + gt + quote + day + '-' + startMonth + '-' + '2000' + quote;
}
else {
querytext += birthday + gt + quote + day + '-' + startMonth + '-' + '2000' + quote;
}
Results.url = _spPageContextInfo.webAbsoluteUrl + "/_api/search/query?querytext=%27" + querytext + "%27&sourceid=%27B09A7990-05EA-4AF9-81EF-EDFAB16C4E31%27&selectproperties=%27Title," + birthday + ",Path,PictureURL,Department%27&sortlist=%27" + birthday + ":ascending%27";
the parameter i get for display the image is PictureURL from user's profile properties
So, if somebody can help me to figure out what's happening and how can i fix it, it will be great!!