Fixed #17401 - SelectDateWidget doesn't display erroneous values

Integrate patch from ticked and added test.
Could this code ever throw an exception for some input input  (e.g. int() cast fails)?