 Automatically add new line
 ###
 onDaily = () ->
-  sheet = ss.getSheets()[0]
-  dump "onDaily - examine date on sheet '%s'", sheet.getName()
-  addNewRow sheet if not isMaxRowCurrent sheet
-  flushLog()
+  dump "onDaily - possibly add new row"
+  checkAndAddNewRow()
   return
 
 ###

  flushLog()
  return

formatRow = (row) ->
  dest = spreadsheet.getRange "A#{row}:A"
  source = dest.offset -1, 0
  source.copyTo dest, formatOnly: true

addNewRow = (sheet) ->
  sheet.appendRow [new Date()]
  row = sheet.getMaxRows()
  formatRow row
  dump "addNewRow new and formatted %s", row

isDateCurrent = (newDate, oldDate) ->
  ny = newDate.getFullYear()
  oy = oldDate.getFullYear()

  dump "onOpen. e:'%s'", e
  initialize(e)
  if autoAddNewLines
    checkAndAddNewRow()
  flushLog()
  return

