angularjs输入24小时格式[时间]

时间:2017-12-22 15:35:30

标签: angularjs

是否可以使用输入[时间]分量(https://docs.angularjs.org/api/ng/input/input%5Btime%5D)以角度显示24小时格式(不显示AM和PM文本)?我发现的所有例子都使用12小时格式。提前谢谢。

1 个答案:

答案 0 :(得分:1)

参见此演示:



<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example - example-time-input-directive-production</title>
  

  <script src="//code.angularjs.org/snapshot/angular.min.js"></script>
  

  
</head>
<body ng-app="timeExample">
  <script>
 angular.module('timeExample', [])
   .controller('DateController', ['$scope', function($scope) {
   }]);
</script>
<form name="myForm" ng-controller="DateController as dateCtrl">
   <input type="time" id="exampleInput" name="input" ng-model="example.value" placeholder="HH:mm:ss" required />
</form>
</body>
</html>

<!-- 
Copyright 2017 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
-->
&#13;
&#13;
&#13;


<input type="time" id="exampleInput" name="input" ng-model="example.value" placeholder="HH:mm:ss" required />