toISOString not supported in IE8

Provided workaround that works in IE8 so that getEntitiesByDateRange
works cross browser.