Angular JS <input type =“time”/>不适用于Mozilla

时间:2016-08-16 06:24:29

标签: angularjs mozilla

请帮助我尝试实现Angular JS,但它不适用于Mozilla

检查Mozilla上的小提琴

<div ng-app ng-controller="HistoryCtrl">
    <input type="date" ng-model="startDate" />
    <input type="time" ng-model="startTime" />
    <input type="date" ng-model="endDate" />
    <input type="time" ng-model="endTime" />
    <button ng-click="updateForm()">Update</button>
    <pre>Start Date: {{ startDate }}
Start Time: {{ startTime }}
End Date: {{ endDate }}

function HistoryCtrl($scope) {

    $scope.result = {
        result: 'success',
        start: '2013-11-23 03:00:00',
        end: '2013-11-24 16:30:00',
        delta: 0.05681799352169
    };

    $scope.updateForm = function () {
        console.log('updating delta balance');
        $scope.updateTimespan($scope.result.start, $scope.result.end);
    };

    $scope.updateTimespan = function (start, end) {
        $scope.startDate = start.split(" ")[0];
        $scope.startTime = start.split(" ")[1];
        $scope.endDate = end.split(" ")[0];
        $scope.endTime = end.split(" ")[1];
    }
}

http://jsfiddle.net/t3m6r/3/

1 个答案:

答案 0 :(得分:0)

截至目前,Mozilla不支持日期,时间,月份以及更多输入类型。

而是使用任何现有的时间选择器。