【问题标题】:How to add time picker to angularJS?如何将时间选择器添加到 angularJS?
【发布时间】:2015-04-13 15:41:31
【问题描述】:

我正在开发一个 angularJS 应用程序。 我想添加可以在 HTML 标签中调用的时间选择器模块?我该怎么做?

应该是这样的

<input type="text" data-ng-model="timeInput" time-pick="HH:MM:SS" time-default="'08:00:00'">

感谢您的宝贵时间。

【问题讨论】:

    标签: angularjs


    【解决方案1】:

    有一个很棒的库,里面有很多小部件。它的名字是UI Bootrstap。 关于您的问题,有一个时间选择器click here。 它当然是一个开源库,您可以根据需要调整小部件。

    【讨论】:

    • 这正是他所需要的
    【解决方案2】:

    示例:

    <!DOCTYPE html>
    <html>
    <body>
    
    <p>
    Depending on browser support:<br>
    A date picker can pop-up when you enter the input field.
    </p>
    
    <form action="action_page.php">
      Birthday:
      <input type="time" name="bday">
      <input type="submit">
    </form>
    
    <p><b>Note:</b> type="date" is not supported in Internet Explorer.</p>
    
    </body>
    </html> 
    

    【讨论】:

      【解决方案3】:

      将日期选择器图形组件(如 jquery ui datepicker)包装到指令中。这是a related answer 的示例。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-08-23
        • 2018-10-08
        • 1970-01-01
        • 1970-01-01
        • 2019-01-11
        相关资源
        最近更新 更多