The problem that when showDateTimePicker is done I need to exit input so I call event.target.blur() which triggers focus event for second time. So basically when showDateTimePickeris called two times.
yeah but you only want to listen on focus to call your custom function. if you run preventDefault at the beginning of your function the default behavior of focussing that input does not happen, but your logic is executed.