Another Mike

  • Home
  • Archive

Ceridian automation

3/28/2011

I used to waste a significant amount of time entering hours into Ceridian. Then I heard from HR that I can't just put the same hours in every day. :-)

Of course, I'm a programmer and I use computers to eliminate boring, mundane work, and chickenfoot (a Firefox addon) is great for automating tasks for websites that are too cumbersome. This is a not very polished script, but it saved me untold hours of data entry over the last couple years.

var startTimes = [0, 15, 30, 45, 60];

for (var day = 1; day <= 10; day++) {
  var pos = Math.round(Math.random() * 4);
  var startTime = new Date();
  startTime.setHours(8, startTimes[pos], 0, 0);

  pos = Math.round(Math.random() * 4);
  var lunchTime = new Date();
  lunchTime.setHours(11, startTimes[pos], 0, 0);

  var lunchStop = new Date();
  lunchStop.setHours(lunchTime.getHours(), lunchTime.getMinutes() + 30);

  var stopTime = new Date();
  stopTime.setHours(startTime.getHours() + 8, startTime.getMinutes() + 30);

  if (day >= 6)
    document.getElementById("Date" + day).selectedIndex = 4 + day;
  else
    document.getElementById("Date" + day).selectedIndex = 2 + day;
  document.getElementById("TimeCode" + day).selectedIndex = 3;
  enter("StartTime" + day, startTime.toLocaleFormat("%R"))
  enter("LunchStart" + day, lunchTime.toLocaleFormat("%R"))
  enter("LunchStop" + day, lunchStop.toLocaleFormat("%R"))
  enter("StopTime" + day, stopTime.toLocaleFormat("%R"))
}