问题
I have an input type of datetime-local which is working fine in chrome but when i try to run the same page in firefox it shows text box instead of datepicker.I have tried using modernizer but still the problem exist can anyone tell me how could the datetime-local issue can be fixed in firefox.
<div class="form-group" ng-class="{'has-error': vm.basicInfoForm.validFrom.$invalid && (vm.basicInfoForm.validFrom.$dirty || vm.basicInfoForm.$submitted)}">
<label translate >.NEW.STARTDATE</label>
<input type="datetime-local" name="validFrom" class="form-control" name="fromdate" ng-model="vm.basicInfo.validFrom"/>
<span class="help-block error-block basic-block" translate>.NEW.CHECKDATE</span>
</div>
回答1:
Is not supported, check their documentation https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#Browser_compatibility
回答2:
Input type "datetime-local" is not supported in Firefox hence it shows a text box, in this case, you can use input type as "date".
As "datetime-local" shows the time as well and if you have the same requirement, you can use Input type "time" also to show the time.
I hope this helps.
来源:https://stackoverflow.com/questions/50567938/input-type-datetime-local-is-not-working-in-firefox