【问题标题】:How to open year firstly then month and then date when bootstrap calender is opened如何在打开引导日历时先打开年份然后再打开月份然后日期
【发布时间】:2017-05-09 06:11:15
【问题描述】:

我正在制作应用程序,需要为用户配置文件选择 DOB。我正在为 DOB 字段使用引导日期选择器,但我需要先打开年份,然后再打开月份和日期作为出生日期 (DOB)。

这是我的配置代码:-

$('#dob').datepicker({
   calendarWeeks: true,
   todayHighlight: true,
   autoclose: true,
   format: 'dd-mm-yyyy'
});

请告诉我对我有帮助的配置。

【问题讨论】:

  • 使用 'yyyy-mm-dd' 格式并通过malot.fr/bootstrap-datetimepicker 这将对您有所帮助。
  • 我不是在谈论日期格式。我说的是日期选择器窗口。就像首先我会选择年,然后是月,然后是那个日期。
  • 你浏览过我提供的链接吗?他们在那里提供了与日期选择相关的演示。 将此代码与 css 更改一起使用(包括本地的 css 更改并检查)。

标签: jquery configuration bootstrap-datepicker


【解决方案1】:

在配置中添加startView: 2

$('#dob').datepicker({
    calendarWeeks: true,
    todayHighlight: true,
    autoclose: true,
    format: 'dd-mm-yyyy',
    startView: 2
});

【讨论】:

    猜你喜欢
    • 2015-08-09
    • 1970-01-01
    • 1970-01-01
    • 2016-12-02
    • 1970-01-01
    • 1970-01-01
    • 2012-01-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多