Fix broken js code; support date picker if browser does not support it natively