Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Santhana Rajhan
Mega Sage

 Use this in the server script

/*******************************/
var rightNow = GlideDateTime();     // Get the current time
var morningStart = 4*60*60*1000;    // Set numeric value of 4 AM
var afternoonStart = 12*60*60*1000; // Set numeric value of 12 Noon
var eveningStart = 18*60*60*1000;   // Set numeric value of 6 PM which 18 in 24  hour format
var welcomeMessage = "";
if(rightNow.getLocalTime().getNumericValue() > morningStart && rightNow.getLocalTime().getNumericValue() < afternoonStart){
	data.greeting = "Good Morning, ";
} else if(rightNow.getLocalTime().getNumericValue() > afternoonStart && rightNow.getLocalTime().getNumericValue() < eveningStart){
	data.greeting = "Good Afternoon, ";
} else{
	data.greeting = "Good Evening, ";
}
/*******************************/
data.name = '';
var firstName = gs.getUser().getFirstName();
if (firstName != '' || firstName != null || firstName != undefined) {
    data.name = gs.getUser().getFirstName();
}
/*******************************/
var aisEnabled = $sp.isAISearchEnabled();

if (aisEnabled) {
    data.typeAheadSearch = $sp.getWidget('typeahead-search', options);
} else {
    data.typeAheadSearch = $sp.getWidget('typeahead-search', options.typeahead_search);
}
/*******************************/
Comments
Wesley Ching
Tera Contributor

Dear Santhana,

Is it a possibilty to share the full widget custom settings? As the server script doesnt seem to work.

Version history
Last update:
‎05-12-2022 01:12 AM
Updated by: