Fix error (Cannot read property 'append' of undefined) on chrome when build the calendar

This error was made on the loop because the reference to the variable "row" was lost between loops.
To fix this, the variable "row" has been declared before loop.