[英]Need 12 hour format without showing AM/PM Timepicker
I am using Timepicker from Angular directive for bootstrap. 我正在使用来自Angular指令的Timepicker进行引导。
I need to have 12 hour format only but without AM/PM 我只需要12小时格式,但没有AM / PM
There is the plunkr link on the site that you can play around with. 您可以在网站上找到一个plunkr链接。
I tried the option $scope.ismeridian = false;
我尝试了
$scope.ismeridian = false;
选项$scope.ismeridian = false;
It let the am/pm hidden but the time count goes to 24 still. 它隐藏了上午/下午,但时间计数仍为24。
Thanks for any help. 谢谢你的帮助。
Apply a class to your timepicker: 将一个类应用于您的时间选择器:
<timepicker class="timepicker" ng-model="mytime" ng-change="changed()" hour-step="hstep" minute-step="mstep" show-meridian="ismeridian"></timepicker>
And then use CSS to hide the AM/PM button: 然后使用CSS隐藏AM / PM按钮:
.timepicker tr:nth-child(2) td:last-child {
display: none;
}
On the plunker link try to change this line: 在插件链接上尝试更改此行:
<pre class="alert alert-info">Time is: {{mytime | date:'shortTime' }}</pre>
to this: 对此:
<pre class="alert alert-info">Time is: {{mytime | date:'HH:mm' }}</pre>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.