DatePicker: checking equality by html element

Fixes #10666