The following function returns true if the date/time passed to it is during the graveyard shift, between 10 p.m. and 6 a.m.:

function isGraveyard(dArg)

  return (dArg.getHours() >= 22 or dArg.getHours() < 6)