简体   繁体   English

Angular / ng-bootstrap 日期时间格式

[英]Angular / ng-bootstrap datetime format

I need help on how to get ng-bootstrap datetimepicker, instead of just datepicker.我需要关于如何获取 ng-bootstrap datetimepicker 的帮助,而不仅仅是 datepicker。

Thislink shows datepicker separate and timepicker separate but I want a datetimepicker instead.链接显示单独的日期选择器和单独的时间选择器,但我想要一个日期时间选择器。 Here is the format that want: 2019-09-10 12:54:30.963852 .这是想要的格式: 2019-09-10 12:54:30.963852

Is there a way to get that format using ng-bootstrap?有没有办法使用 ng-bootstrap 获取该格式?

Below is HTML example for ng-bootstrap datepicker:下面是 ng-bootstrap 日期选择器的 HTML 示例:

<div class="form-group">
    <label>Date:</label> <input type="text" class="form-control" placeholder="yyyy-mm-dd" ngbDatepicker #d="ngbDatepicker"**strong text** required>
    <button (click)="d.toggle()"><i class="glyphicon glyphicon-calendar"></i></button>
</div>

Thanks谢谢

With normal Bootstrap you can specify the format:使用普通 Bootstrap,您可以指定格式:

format: 'Y-M-D hh:mm:ss:SSSSSS'

See this example: https://jsfiddle.net/6v8zs7a5/2/看这个例子: https : //jsfiddle.net/6v8zs7a5/2/

Something like this should work with ng-bootstrap as well.像这样的东西也应该与 ng-bootstrap 一起工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM