什么是角/引导建议的日期选择器? [英] What is the recommended date picker for Angular/Bootstrap?

查看:86
本文介绍了什么是角/引导建议的日期选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有几种选择使用角/引导时添加日期选择器控制。是否有一个是更好?

There are several choices for adding a date picker control when using Angular/Bootstrap. Is there one that is "better"?

下面是我发现:


  • HTML 5输入类型日期:在不同的浏览器支持不一致

  • 角UI / UI更新:似乎是​​一个简单的基于指令的解决方案围绕jQueryUI的日期选择器包裹

  • ui.bootstrap.datepicker:提供一个弹出式的用户可能会喜欢,对JQuery的不依赖

乍一看,似乎在引导日期选择器可能会更易于使用,因为它并不需要包括JQuery的。但我不知道如果我失去往那个方向的任何功能。

At first glance, it seemed that the Bootstrap date picker may be easier to use because it does not require including JQuery. But I wasn't sure if I was losing any functionality going that way.

推荐答案

角UI的引导日期选择器是更好的选择,如果你已经在您的角度引导项目。具有角的新版本,输入类型日期可以在两个方向进行分析,并与棱角分明的UI datepicker的引导工作的伟大。 (与旧版本,你可以'补丁'角与输入的日期工种)。当然,角UI日期选择器可以在没有日期输入型工作,以及(它只是一个额外的好处)

Angular-ui's bootstrap datepicker is the better choice if you already include bootstrap in your angular project. With the newer version of Angular, input types of date can be parsed in both directions and will work great with angular-ui bootstrap datepicker. (with older version, you can 'patch' angular to work with date input types). Of course the angular-ui datepicker can work without the date input type as well (its just an added bonus)

使用角UI自举日期选择器之前,我们使用jQuery UI的的日期选择器,并有大约不是一个javascript日期的日期值的一些问题。起初它是很好,我们做了想要的一切,但试图做更复杂的事情时,我们遇到了问题。

Before using the angular-ui bootstrap datepicker, we used jquery ui's datepicker and had some problem around the value of the date not being a javascript date. At first it was fine and did everything we wanted, but when trying to do more complex things we ran into problems.

您也许可以通过自己的指令,并进入基本事实解决了jQuery UI的问题,但棱角分明的UI的引导日期选择器只是工作外的开箱。

You could probably solve the jquery ui problems by making your own directive and getting into the nitty-gritty, but angular-ui's bootstrap datepicker just works out-of-the-box.

这篇关于什么是角/引导建议的日期选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆