Range/Term query/filter on dates fail to handle numbers properly

When providing a number (milliseconds since epoch, UTC), range and term query/filter don't handle it correctly and convert it to a string, that is then first tried to parse as a date