add check for empty raw value

Previously grouping by dates results in empty labels for tickets without a date value.

This fixes the following warnings:
Use of uninitialized value in join or string at /opt/rtgit/share/html/Search/Chart line 274
Use of uninitialized value in join or string at /opt/rtgit/share/html/Search/Chart line 302
fix sorting empty date values

Date values can be empty so we have to account this while sorting.
This fixes "Use of uninitialized value in string comparison (cmp)" warnings.
Merge branch '4.2/chart-group-by-dates-empty-values' into 4.2-trunk