DSpace-Labs/angular2-ui-prototype

Date input field doesn't work well in Firefox

Opened this issue · 3 comments

This is a known issue, but just wanted to log it so it isn't forgotten.

When creating a new item in Chrome, the Date input field provides a nice date selection / calendar view. However, in other browsers (e.g. Firefox), this input field just looks like a textbox and provides no date validation functionality.

It would seem that firefox does not support date as an input type yet. From caniuse.com

The same goes for some other browsers.

I guess we can use something like Modernizr to fall back on a javascript datepicker in case the browser does not support ìnput type="date"?

We may also be able to switch to using the ng2-bootstrap Datepicker directive:
http://valor-software.com/ng2-bootstrap/#datepicker

We already are using ng2-bootstrap in other areas.

Looks like ng2-bootstrap also has a DatepickerPopup directive that is in the works:
valor-software/ngx-bootstrap#273

Code has begun here: https://github.com/valor-software/ng2-bootstrap/blob/development/components/datepicker/datepicker-popup.component.ts

Currently, it is possible to just use their Datepicker, but we'd have to likely use it in conjunction with a toggle/collapse option to show/hide it. Ideally though, it sounds like we would want the popup to achieve an experience similar to what Chrome provides with input type="date".