Fix trimDays() function - it can now handle a 1-key table and it will no longer
create "undefined" keys.