fix bug when time_types is an empty array.

I do not know why it is this way, but this makes
the timelines.js code more robust and fixes the bug.
Merge pull request #539 from opf/fix/no_data_to_display