最新datetimepicker用法总结

最新datetimepicker用法总结首先简单的介绍一下官网上的 然后再看看 nbsp datetimepick 中的影藏福利 官网 选项 formatString 默认值 mm dd yyyy 日期格式 p P h hh i ii s ss d dd m mm M MM yy yyyy 的任意组合 weekStartInt

首先简单的介绍一下官网上的,然后再看看 datetimepicker 中的影藏福利!

官网:

选项

format

String. 默认值: ‘mm/dd/yyyy’

日期格式, p, P, h, hh, i, ii, s, ss, d, dd, m, mm, M, MM, yy, yyyy 的任意组合。

weekStart

Integer. 默认值:0

一周从哪一天开始。0(星期日)到6(星期六)

startDate

Date. 默认值:开始时间

endDate

Date. 默认值:结束时间

daysOfWeekDisabled

String, Array. 默认值: ”, [],用于设置一周中不可选取的时间(如星期六、星期日)

autoclose

Boolean. 默认值:false

当选择一个日期之后是否立即关闭此日期时间选择器。

startView

Number, String. 默认值:2, ‘month’

日期时间选择器打开之后首先显示的视图。 可接受的值:

  • 0 or ‘hour’ for the hour view
  • 1 or ‘day’ for the day view
  • 2 or ‘month’ for month view (the default)
  • 3 or ‘year’ for the 12-month overview
  • 4 or ‘decade’ for the 10-year overview. Useful for date-of-birth datetimepickers.

minView

Number, String. 默认值:0, ‘hour’

日期时间选择器所能够提供的最精确的时间选择视图。

maxView

Number, String. 默认值:4, ‘decade’

日期时间选择器最高能展示的选择范围视图。

todayBtn

Boolean, “linked”. 默认值: false

如果此值为true 或 “linked”,则在日期时间选择器组件的底部显示一个 “Today” 按钮用以选择当前日期。如果是true的话,”Today” 按钮仅仅将视图转到当天的日期,如果是”linked”,当天日期将会被选中。

todayHighlight

Boolean. 默认值: false

如果为true, 高亮当前日期。

keyboardNavigation

Boolean. 默认值: true

是否允许通过方向键改变日期。

language

String. 默认值: ‘en’

forceParse

Boolean. 默认值: true

当选择器关闭的时候,是否强制解析输入框中的值。也就是说,当用户在输入框中输入了不正确的日期,选择器将会尽量解析输入的值,并将解析后的正确值按照给定的格式format设置到输入框中。

minuteStep

Number. 默认值: 5

此数值被当做步进值用于构建小时视图。对于每个 minuteStep 都会生成一组预设时间(分钟)用于选择。

pickerReferer : 不建议使用

String. 默认值: ‘default’ (other value available : ‘input’)

The referer element to place the picker for the component implementation. If you want to place the picker just under the input field, just specify input.

pickerPosition

String. 默认值: ‘bottom-right’ (还支持 : ‘bottom-left’)

此选项当前只在组件实现中提供支持。通过设置选项可以讲选择器放倒输入框下方。

viewSelect

Number or String. 默认值: same as minView (supported values are: ‘decade’, ‘year’, ‘month’, ‘day’, ‘hour’)

With this option you can select the view from which the date will be selected. By default it’s the last one, however you can choose the first one, so at each click the date will be updated.

showMeridian

Boolean. 默认值: false

This option will enable meridian views for day and hour views.

initialDate

Date or String. 默认值: new Date()

You can initialize the viewer with a date. By default it’s now, so you can specify yesterday or today at midnight …


方法

.datetimepicker(options)

初始化日期时间选择器。

remove

参数: None

移除日期时间选择器。同时移除已经绑定的event、内部绑定的对象和HTML元素。

show

参数: None

显示日期时间选择器。

hide

参数: None

隐藏日期时间选择器。

update

参数: None

使用当前输入框中的值更新日期时间选择器。

setStartDate

参数:

  • startDate (String)

给日期时间选择器设置一个新的起始日期。

setEndDate

参数:

  • endDate (String)

给日期时间选择器设置结束日期。

setDaysOfWeekDisabled

参数:

  • daysOfWeekDisabled (String|Array)

Sets the days of week that should be disabled.

下面来看看影藏福利。

福利:

选项

container

String. 默认值: ‘body

formatType

String. 默认值: ‘standard

日期数据格式类型,有php、standard两种。

fontAwesome

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

bootcssVer

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

showMeridian

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

title

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

timezone

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

formatViewType

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

todayBtn

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

clearBtn

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

todayHighlight

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

onRenderDay

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

onRenderHour

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

onRenderMinute

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

onRenderYear

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

onRenderMonth

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

datesDisabled

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

minutesDisabled

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。

hoursDisabled

String. 默认值: false

false表示默认图标(时间选择器中的箭头),可添加 fontAwesome 中的类名来添加样式。
























版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/232618.html原文链接:https://javaforall.net

(0)
上一篇 2025年9月27日 下午1:01
下一篇 2025年9月27日 下午1:22


相关推荐

  • 中文参数乱码问题——js字符串编码

    中文参数乱码问题——js字符串编码jquery.get中文参数问题——js符串编码摘要:使用jquery.get进行ajax请求获取数据是很常见的操作,一般请求参数都为字母,今天发现在参数中使用中文会出现浏览器兼容性问题,现在记录如下。基本使用语法:$(selector).get(url,data,success(response,status,xhr),dataType)参数 描述url 必需。规定将请求

    2022年6月5日
    36
  • Resnet 18 可跑完整pytroch代码「建议收藏」

    Resnet 18 可跑完整pytroch代码「建议收藏」importtorchimporttorch.nnasnnimporttorch.optimasoptimimporttorchvisionimporttorchvision.transformsastransformsimportargparsefromresnet18importResNet18#定义是否使用GPUdevice=torch…

    2022年5月26日
    39
  • lasso回归-回归实操

    lasso回归-回归实操pythonlasso回归算法之回归实操基本概念正则化正则化是指对模型做显式约束,以避免过拟合。本文用到的lasso回归就是L1正则化。(从数学的观点来看,lasso惩罚了系数向量的L1范数,换句话说,就是系数的绝对值之和。)正则化的具体原理就不在这里多叙述了,感兴趣的朋友可以看一下这篇文章:机器学习中正则化项L1和L2的直观理解。算法简介lasso回归在了解lasso回归之前,建议朋友们先对普通最小二乘法和岭回归做一些了解,可以参考这两篇文章:最小二乘法-回归实操,岭回归-回归实操。除了

    2022年5月8日
    63
  • 阿里Qwen-Image-Edit-2509:多图融合技术重构创意生产,电商海报制作成本降60%

    阿里Qwen-Image-Edit-2509:多图融合技术重构创意生产,电商海报制作成本降60%

    2026年3月12日
    2
  • fastCGI详解「建议收藏」

    fastCGI详解「建议收藏」http{#缓存路径fastcgi_cache_path/usr/local/nginx/fastcgi_cachelevels=1:2keys_zone=licache:10minact

    2022年7月4日
    26
  • navicat 15 最新 激活码_在线激活

    (navicat 15 最新 激活码)JetBrains旗下有多款编译器工具(如:IntelliJ、WebStorm、PyCharm等)在各编程领域几乎都占据了垄断地位。建立在开源IntelliJ平台之上,过去15年以来,JetBrains一直在不断发展和完善这个平台。这个平台可以针对您的开发工作流进行微调并且能够提供…

    2022年4月1日
    142

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号