Write calendar to string instead of file