DEVSUPPORT-1038: Fix the bug for empty dateFrom and dateTo.

Due to the attributes dateFrom and dateTo are optional to both element name and location, so
1) add them to name element only when the values are valid and not empty.
2) add them to location element only when the values are valid and not empty.