/* =========================================================
* bootstrap-datetimepicker.js
* =========================================================
* Copyright 2012 Stefan Petre
*
* Improvements by Andrew Rowls
* Improvements by Sébastien Malot
* Improvements by Yun Lai
* Improvements by Kenneth Henderick
* Improvements by CuGBabyBeaR
* Improvements by Christian Vaas
*
* Project URL : http://www.malot.fr/bootstrap-datetimepicker
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
!function ($) {
// Add ECMA262-5 Array methods if not supported natively (IE8)
if (!('indexOf' in Array.prototype)) {
Array.prototype.indexOf = function (find, i) {
if (i === undefined) i = 0;
if (i < 0) i += this.length;
if (i < 0) i = 0;
for (var n = this.length; i < n; i++) {
if (i in this && this[i] === find) {
return i;
}
}
return -1;
}
}
function elementOrParentIsFixed (element) {
var $element = $(element);
var $checkElements = $element.add($element.parents());
var isFixed = false;
$checkElements.each(function(){
if ($(this).css('position') === 'fixed') {
isFixed = true;
return false;
}
});
return isFixed;
}
function UTCDate() {
return new Date(Date.UTC.apply(Date, arguments));
}
function UTCToday() {
var today = new Date();
return UTCDate(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate(), today.getUTCHours(), today.getUTCMinutes(), today.getUTCSeconds(), 0);
}
// Picker object
var Datetimepicker = function (element, options) {
var that = this;
this.element = $(element);
// add container for single page application
// when page switch the datetimepicker div will be removed also.
this.container = options.container || 'body';
this.language = options.language || this.element.data('date-language') || 'en';
this.language = this.language in dates ? this.language : this.language.split('-')[0]; // fr-CA fallback to fr
this.language = this.language in dates ? this.language : 'en';
this.isRTL = dates[this.language].rtl || false;
this.formatType = options.formatType || this.element.data('format-type') || 'standard';
this.format = DPGlobal.parseFormat(options.format || this.element.data('date-format') || dates[this.language].format || DPGlobal.getDefaultFormat(this.formatType, 'input'), this.formatType);
this.isInline = false;
this.isVisible = false;
this.isInput = this.element.is('input');
this.fontAwesome = options.fontAwesome || this.element.data('font-awesome') || false;
this.bootcssVer = options.bootcssVer || (this.isInput ? (this.element.is('.form-control') ? 3 : 2) : ( this.bootcssVer = this.element.is('.input-group') ? 3 : 2 ));
this.component = this.element.is('.date') ? ( this.bootcssVer == 3 ? this.element.find('.input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-calendar, .input-group-addon .glyphicon-calendar, .input-group-addon .fa-calendar, .input-group-addon .fa-clock-o').parent() : this.element.find('.add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar .fa-calendar .fa-clock-o').parent()) : false;
this.componentReset = this.element.is('.date') ? ( this.bootcssVer == 3 ? this.element.find('.input-group-addon .glyphicon-remove, .input-group-addon .fa-times').parent():this.element.find('.add-on .icon-remove, .add-on .fa-times').parent()) : false;
this.hasInput = this.component && this.element.find('input').length;
if (this.component && this.component.length === 0) {
this.component = false;
}
this.linkField = options.linkField || this.element.data('link-field') || false;
this.linkFormat = DPGlobal.parseFormat(options.linkFormat || this.element.data('link-format') || DPGlobal.getDefaultFormat(this.formatType, 'link'), this.formatType);
this.minuteStep = options.minuteStep || this.element.data('minute-step') || 5;
this.pickerPosition = options.pickerPosition || this.element.data('picker-position') || 'bottom-right';
this.showMeridian = options.showMeridian || this.element.data('show-meridian') || false;
this.initialDate = options.initialDate || new Date();
this.zIndex = options.zIndex || this.element.data('z-index') || undefined;
this.icons = {
leftArrow: this.fontAwesome ? 'fa-arrow-left' : (this.bootcssVer === 3 ? 'glyphicon-arrow-left' : 'icon-arrow-left'),
rightArrow: this.fontAwesome ? 'fa-arrow-right' : (this.bootcssVer === 3 ? 'glyphicon-arrow-right' : 'icon-arrow-right')
}
this.icontype = this.fontAwesome ? 'fa' : 'glyphicon';
this._attachEvents();
this.clickedOutside = function (e) {
// Clicked outside the datetimepicker, hide it
if ($(e.target).closest('.datetimepicker').length === 0) {
that.hide();
}
}
this.formatViewType = 'datetime';
if ('formatViewType' in options) {
this.formatViewType = options.formatViewType;
} else if ('formatViewType' in this.element.data()) {
this.formatViewType = this.element.data('formatViewType');
}
this.minView = 0;
if ('minView' in options) {
this.minView = options.minView;
} else if ('minView' in this.element.data()) {
this.minView = this.element.data('min-view');
}
this.minView = DPGlobal.convertViewMode(this.minView);
this.maxView = DPGlobal.modes.length - 1;
if ('maxView' in options) {
this.maxView = options.maxView;
} else if ('maxView' in this.element.data()) {
this.maxView = this.element.data('max-view');
}
this.maxView = DPGlobal.convertViewMode(this.maxView);
this.wheelViewModeNavigation = false;
if ('wheelViewModeNavigation' in options) {
this.wheelViewModeNavigation = options.wheelViewModeNavigation;
} else if ('wheelViewModeNavigation' in this.element.data()) {
this.wheelViewModeNavigation = this.element.data('view-mode-wheel-navigation');
}
this.wheelViewModeNavigationInverseDirection = false;
if ('wheelViewModeNavigationInverseDirection' in options) {
this.wheelViewModeNavigationInverseDirection = options.wheelViewModeNavigationInverseDirection;
} else if ('wheelViewModeNavigationInverseDirection' in this.element.data()) {
this.wheelViewModeNavigationInverseDirection = this.element.data('view-mode-wheel-navigation-inverse-dir');
}
this.wheelViewModeNavigationDelay = 100;
if ('wheelViewModeNavigationDelay' in options) {
this.wheelViewModeNavigationDelay = options.wheelViewModeNavigationDelay;
} else if ('wheelViewModeNavigationDelay' in this.element.data()) {
this.wheelViewModeNavigationDelay = this.element.data('view-mode-wheel-navigation-delay');
}
this.startViewMode = 2;
if ('startView' in options) {
this.startViewMode = options.startView;
} else if ('startView' in this.element.data()) {
this.startViewMode = this.element.data('start-view');
}
this.startViewMode = DPGlobal.convertViewMode(this.startViewMode);
this.viewMode = this.startViewMode;
this.viewSelect = this.minView;
if ('viewSelect' in options) {
this.viewSelect = options.viewSelect;
} else if ('viewSelect' in this.element.data()) {
this.viewSelect = this.element.data('view-select');
}
this.viewSelect = DPGloba
没有合适的资源?快使用搜索试试~ 我知道了~
修改后的bootstrap-datetimepicker,可以选择秒的版本
共2个文件
js:1个
css:1个
4星 · 超过85%的资源 需积分: 44 302 下载量 37 浏览量
2018-05-23
14:53:41
上传
评论 2
收藏 15KB ZIP 举报
温馨提示
这是修改版的,可以选择秒,原版是没有的,具体用法参考博客 https://blog.csdn.net/lianzhang861/article/details/80419775
资源推荐
资源详情
资源评论
收起资源包目录
bootstrap-datetimepicker.zip (2个子文件)
bootstrap-datetimepicker
bootstrap-datetimepicker.js 65KB
bootstrap-datetimepicker.min.css 11KB
共 2 条
- 1
资源评论
- cheng_ge_jc2019-10-11不错 是好的豆趣编程2019-10-30东西没问题,问题csdn自动设置的积分现在咋这么高了
- adammleve2019-05-21这个资源没下载成功,要再下一次豆趣编程2019-10-30可能csdn出bug了,这种情况可以私信我给你发~
- aimy_liuqinyan2019-05-06还可以,不错,好用
豆趣编程
- 粉丝: 2w+
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 学院期间学习代码,包括C,Python,HTML, Java等代码.zip
- 控制原理之经典传递函数
- 全国大学生电子设计竞赛 历年赛题(1994-2023)
- Unity适用于Windows与移动平台双端的轮盘交互式提示菜单
- UE5/UE4超详细教程接入科大讯飞语音唤醒SDK并初始持久监听(10102错误码解决)
- 靠搬运古装剧解说视频,日收益200+,作品原创度90%以上,超详细教程-教程网盘链接提取码下载 .txt
- 2024最强数学建模之美赛攻略.md
- STM32单片机FPGA毕设电路原理论文报告一种机器人寻线控制系统
- STM32单片机FPGA毕设电路原理论文报告一种光电编码器位置检测系统研究与应用
- linux常用命令大全
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功