adding define and template to generate timeperiods
Merge branch 'f_timeperiods' into arin