Moved check for dates vars into getBoxHist() function