jscript example from work

Welcome to Siddharth, Mae, Bao-An, Ryan, Sitra, Hoyong, and Janet, who meet Mondays and Wednesdays, (but no class on January 21st ) in January of 2019 at Collin College, the courtyard campus to learn how to READ JavaScript code -- plus we learn some programming. JavaScript forms the basic Language of the web; it's the glue between the HTML and CSS actions that form the Transformation in a browser or API call.
Post Reply
maechoi
Posts: 6
Joined: Wed Jan 09, 2019 6:39 pm

jscript example from work

Post by maechoi » Wed Jan 23, 2019 5:35 pm

// -------------------------------------------------------------------------
// -------------- OnSave -------------
// -------------------------------------------------------------------------
//Set the effective date = 30(the waiting period) days from date of hire, regardless of eligibility date
/*
Event.Engine.EffectiveDate = Event.Employee.DateOfHire.AddDays(Event.Config.WaitingPeriod);

if (Event.Employee && Event.Employee.EmployeeEvents)
{
for (var empEvent in Event.Employee.EmployeeEvents)
{
if (empEvent.Reason)
{
var EventReason = empEvent.Reason;
if (EventReason.Contains("from PRN FullTime to") || EventReason.Contains("from PRN to"))
{
Event.Debug("EE Event - Change effective date.");
var NewEffectiveDate = new DateTime(empEvent.EventDate.Year, empEvent.EventDate.Month, empEvent.EventDate.Day);
Event.Engine.EffectiveDate = NewEffectiveDate.AddDays(30);
}
}
}
}
//Event.Debug("Event.Engine.EffectiveDate: {0}", Event.Engine.EffectiveDate);
*/
// -------------------------------------------------------------------------
// -------------- OnLifeEvent -------------
// -------------------------------------------------------------------------
//OnLifeEvent JLP 07/17/2018
//If employee goes from Full time to Part time set correct Coverage Termination Date.
function CheckEligible(JobClass)
{
for (var i in JobClass)
{
if(Event.Employee.JobClass.Code == JobClass)
{
return true;
}
}
return false;
}

var jClass = new Array("Parttime-Ineligible");
if (Event.EventType == "JobClassChanged" && CheckEligible(jClass))
{
Event.Action.TerminationDate = Event.EventDate;
}



Post Reply