精华内容
下载资源
问答
  • jQuery日期控件

    2018-04-23 20:51:34
    jQuery日期控件
  • jquery日期控件

    2017-08-26 09:10:00
    好用的jquery日期控件,包含多种样式的时间列表。
  • Jquery 日期控件

    2013-09-08 22:34:28
    Jquery 日期控件 src: html lang="en">head> meta charset="utf-8" /> title>jQuery UI Datepicker - Default functionalitytitle> link rel="stylesheet" href=...

    Jquery 日期控件

    src:

    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="utf-8" />
    <title>jQuery UI Datepicker - Default functionality</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <script>
    $(function() {
    $( "#datepicker" ).datepicker();
    });
    </script>
    </head>
    <body>
    <p>Date: <input type="text" id="datepicker" /></p>
    </body>
    </html>

    图片:


    展开全文
  • JQuery日期控件

    2009-11-30 13:17:08
    JQuery日期控件(改进),日期样式为:yyyy-mm-dd hh:mi
  • 多功能jQuery日期控件

    2017-12-04 15:18:36
    多功能jQuery日期控件 jeDate 多功能jQuery日期控件 jeDate
  • 多功能jQuery日期控件,多功能jQuery日期控件2018
  • 多功能jQuery日期控件 jeDate,旨在为大家提供好用的日期工具多功能jQuery日期控件 jeDate,旨在为大家提供好用的日期工具
  • JQuery 日期控件

    2011-06-17 17:38:28
    JQuery提供了很多控件, 例如用于选择日期的日期控件(Date Picker)。这些控件并没有随Jquery的核心库一并发布。而是作为一个叫做"JQuery UI"的子项目——或者叫做插件——的形式发布。 所以, 我们除了...

    JQuery提供了很多控件, 例如用于选择日期的日期控件(Date Picker)。这些控件并没有随Jquery的核心库一并发布。而是作为一个叫做"JQuery UI"的子项目——或者叫做插件——的形式发布。
    所以, 我们除了要在页面中引用jquery的那个js文件外, 还需要在http://jqueryui.com/下载与我们使用JQuery对应版本的JQuery UI的程序包。
    目前, 最新的JQuery版本是1.3。 与这个版本对应的JQuery UI版本是1.6rc6。
    由 于JQuery UI采取了显示和功能分离的设计(皮肤, 或者叫”换肤“)。所以, 我们需要为日期控件附加样式。JQuery UI最神奇的特点之一就是提供了一个网站来给我们修改控件的样式:http://jqueryui.com/themeroller/。在这个页面中, 将控件样式调整满意后, 点击左侧的"Download theme"按钮。就可以把样式下载下来了。现在, 下载的是JQuery UI1.6rc5版本所使用的样式库。如果您用的较低的1.5, 那么请注意在点击”Download theme“按钮后出现页面的右侧选择相应的版本。不然, 不同版本的样式是不兼容的。
    将下载下来的zip包解开, 我们可以看到里面已经准备好我们要用jquery核心库和JQuery UI的库。首先, 我们把jquery-1.3.x.js复制到网站的js目录下,jquery-ui-personalized-1.6rc6.min.js、i18n目 录、theme目录复制到网站js/ui目录下。
    JQuery核心库的安装非常简单, 我们把jquery.1.3.x.js文件引入页面即可。一般来说, 我们会把这个js文件改名为jquery.js, 放到“/js"目录下。
    然后, 我们将jquery-ui-personalized-1.6rc6.min.js引入页面。如果觉得它的文件名太长。可以直接改成jquery- ui.js或者其他比较短的名字。
    最 后, 引入分别引入js/ui/theme/ui.all.css样式表以及/js/ui/i18n/ui.datepicker-zh-CN.js脚本文件到 页面中。就完成了中文日期控件的安装。如果我们需要其他语言的空间, 请更换ui.datepicker-zh-CN.js文件。在js/ui/i18n中有很多其他语言的脚本。
    终于, 我们可以在页面中,给某个输入框绑定一个日期控件了。例如, 我们的页面中有这么一个input:
    <input type="text" id="birthday" name="birthday"/>
    那么, 我们可以在$(document).ready()的事件函数(不懂的可以参见Jquery核心库的说明或者网上的相关资料)中写:$("birthday").datepicker();
    现在打开页面, 如果不出意外。当我们点击这个文本框的时候就可以出现一个很炫的日期控件了。

    现在修改一下:$("#bithday").attr("readonly", "true").datepicker(); 这样一来,用户就不能手工输入, 而只能通过控件选择日期了。

    上面简单介绍了一下日期控件的使用方法。其实, 他们的可定制性是非常高的。今天我们只是使用了它们最简单最基本的功能。

     

     

       $("#regDate").datepicker(
         {
        showMonthAfterYear: true, // 月在年之后显示
        changeMonth: true,   // 允许选择月份
        changeYear: true,   // 允许选择年份
        dateFormat:'yy-mm-dd',  // 设置日期格式
        closeText:'关闭',   // 只有showButtonPanel: true才会显示出来
        duration: 'fast',
        showAnim:'fadeIn',
        showOn:'button',   // 在输入框旁边显示按钮触发,默认为:focus。还可以设置为both
        buttonImage: 'images/commons/calendar.gif',   // 按钮图标
        buttonImageOnly: true,        // 不把图标显示在按钮上,即去掉按钮
        buttonText:'选择日期',
        showButtonPanel: true,
        showOtherMonths: true,
        //appendText: '(yyyy-mm-dd)',
        });

     

    展开全文
  • jquery日期控件美化日期选择页面,里面包含日期选择页面实例案例,以及jquery等js文件。
  • 精确到秒的JQuery日期控件,日期控件,日期插件
  • jquery 日期控件

    2013-07-30 11:08:00
    控件官网: http://www.interidea.org/demo/icalendar.php#demohtml绑定控件 1 $("#startdate").icalendar({ use: true, show: true, className: "startcalendar" }); 2 $("#enddate").icalendar({ use: true...
    控件官网: http://www.interidea.org/demo/icalendar.php#demo

    html
    绑定控件
    1 $("#startdate").icalendar({ use: true, show: true, className: "startcalendar" });
    2             $("#enddate").icalendar({ use: true, show: true, className: "endcalendar" });

     

     
     1 <div id="datecalendar" >
     2             <div class="date">
     3                 <span><a href="javascript:void(0)" onclick="faster('今天')">今天</a></span>
     4                 <span><a href="javascript:void(0)" onclick="faster('昨天')">昨天</a></span>
     5                 <span><a href="javascript:void(0)" onclick="faster('近七天')">近七天</a></span>
     6                 <span><a href="javascript:void(0)" onclick="faster('本月')">本月</a></span>
     7                 <span><a href="javascript:void(0)" onclick="faster('上个月')">上个月</a></span>
     8             </div>
     9             <div>
    10                 <div id="startdiv">
    11                     <div style="padding:5px 0px;">开始时间:<span id="startdate">@ViewBag.begincalendar</span></div>     
    12                     <div class="startcalendar"></div>
    13                 </div>
    14                 <div id="enddiv">
    15                     <div style="padding:5px 0px;">结束时间:<span id="enddate">@ViewBag.endcalendar</span></div>
    16                     <div class="endcalendar"></div>
    17                 </div>
    18                 <div style="clear:both;"></div>
    19             </div>
    20             <div id="btns">
    21                 <input type="button" value="确定" onclick="queding()" />
    22                 <input type="button" value="取消" onclick="qx()"/>
    23             </div>
    24         </div>

     


    设置的css
     1 .startcalendar{width:210px; z-index:9998; display:none; background:#FFF; border:#ddd solid 1px; overflow:hidden; margin:1px 0px;}
     2 .startcalendar dl{ width:208px; margin:0px; padding:1px; display:block; float:left;}
     3 .startcalendar dl dt{ width:100%; height:25px; line-height:25px; background:#EEE; font-size:0px; word-spacing:0px; text-align:center; vertical-align:top; }
     4 .startcalendar dl dt a,.startcalendar dl dt .empty{ display:inline-block; width:10%; text-decoration:none; font-size:11px; color:#333; }
     5 .startcalendar dl dt a:hover{ background:#CCC; color:#FFF; }
     6 .startcalendar dl dt span{ display:inline-block; width:80%; font-size:12px; cursor:pointer; }
     7 .startcalendar dl dt span a{ display:inline; width:auto; font-size:12px; font-weight:bold; color:#333; margin:0px 2px; text-decoration:underline; }
     8 .startcalendar dl dt span a:hover{ background:none; color:#F05400; }
     9 .startcalendar dd { width:100%; margin:0px; padding:0px; font-size:0px; word-spacing:-11px; text-align:left; vertical-align:top; text-align:center;}
    10 .startcalendar dd div{background:#FAFAFA;}
    11 .startcalendar dd div span,
    12 .startcalendar dd span{ display:inline-block; width:14%; height:25px; line-height:25px; font-size:12px; word-spacing:normal; text-align:center; color:#666; vertical-align:top; }
    13 .startcalendar dd span a, .startcalendar dd span span{ display:inline-block; width:100%; line-height:25px; text-decoration:none; color:#666;}
    14 .startcalendar dd span a:hover{color:#F05400; background:#FFDFBF;}
    15 .startcalendar dd span .selected{background:#FFFF66;}
    16 .startcalendar dd span .disable{color:#BBB; background:#EEE;}
    17 .startcalendar dd span .area{color:#F05400; background:#FFDFBF;}
    18 .startcalendar dd .month,
    19 .startcalendar dd .year {width:25%; height:50px; }
    20 .startcalendar dd .month a,
    21 .startcalendar dd .year a{width:100%; height:50px; line-height:50px; overflow:hidden;}
    22 .startcalendar dd .week0 {color:#FF4400; }
    23 .startcalendar dd .week6 {color:#88CC00; }
    24 .startcalendar .close { display:block; font-size:10px; text-align:right; background:#EEE; width:100%; }
    25 .startcalendar .close a{ display:inline-block; line-height:14px; width:14px; margin-right:5px; text-align:center; text-decoration:none; color:#333;}
    26 .startcalendar .close a:hover{ background:#CCC;}
    27 
    28 
    29 .endcalendar{width:210px; z-index:9998; display:none; background:#FFF; border:#ddd solid 1px; overflow:hidden; margin:1px 0px;}
    30 .endcalendar dl{ width:208px; margin:0px; padding:1px; display:block; float:left;}
    31 .endcalendar dl dt{ width:100%; height:25px; line-height:25px; background:#EEE; font-size:0px; word-spacing:0px; text-align:center; vertical-align:top; }
    32 .endcalendar dl dt a,.endcalendar dl dt .empty{ display:inline-block; width:10%; text-decoration:none; font-size:11px; color:#333; }
    33 .endcalendar dl dt a:hover{ background:#CCC; color:#FFF; }
    34 .endcalendar dl dt span{ display:inline-block; width:80%; font-size:12px; cursor:pointer; }
    35 .endcalendar dl dt span a{ display:inline; width:auto; font-size:12px; font-weight:bold; color:#333; margin:0px 2px; text-decoration:underline; }
    36 .endcalendar dl dt span a:hover{ background:none; color:#F05400; }
    37 .endcalendar dd { width:100%; margin:0px; padding:0px; font-size:0px; word-spacing:-11px; text-align:left; vertical-align:top; text-align:center;}
    38 .endcalendar dd div{background:#FAFAFA;}
    39 .endcalendar dd div span,
    40 .endcalendar dd span{ display:inline-block; width:14%; height:25px; line-height:25px; font-size:12px; word-spacing:normal; text-align:center; color:#666; vertical-align:top; }
    41 .endcalendar dd span a, .endcalendar dd span span{ display:inline-block; width:100%; line-height:25px; text-decoration:none; color:#666;}
    42 .endcalendar dd span a:hover{color:#F05400; background:#FFDFBF;}
    43 .endcalendar dd span .selected{background:#FFFF66;}
    44 .endcalendar dd span .disable{color:#BBB; background:#EEE;}
    45 .endcalendar dd span .area{color:#F05400; background:#FFDFBF;}
    46 .endcalendar dd .month,
    47 .endcalendar dd .year {width:25%; height:50px; }
    48 .endcalendar dd .month a,
    49 .endcalendar dd .year a{width:100%; height:50px; line-height:50px; overflow:hidden;}
    50 .endcalendar dd .week0 {color:#FF4400; }
    51 .endcalendar dd .week6 {color:#88CC00; }
    52 .endcalendar .close { display:block; font-size:10px; text-align:right; background:#EEE; width:100%; }
    53 .endcalendar .close a{ display:inline-block; line-height:14px; width:14px; margin-right:5px; text-align:center; text-decoration:none; color:#333;}
    54 .endcalendar .close a:hover{ background:#CCC;}
    55 
    56 
    57 #datecalendar{width:436px; float:left;background: #EEE;padding: 10px; border: 1px solid #DDD; z-index:9999;}
    58 #datecalendar .date span{background:#fff; padding:4px 8px; border:1px solid #ddd;}
    59 #datecalendar .date span a:hover{color:#CA7400;}
    60 #startdiv,#enddiv{width:212px; float:left; margin-top:10px;}
    61 #startdiv{margin-right:10px;}
    62 #btns{float:left;margin-top: 5px;}

    显示效果:

    点击上边的 “今天、昨天、近七天”等按钮直接进行搜索列出,或者在下班两个日历中选择开始时间和结束时间,点击确定按钮,按照选择的时间段进行搜索

    转载于:https://www.cnblogs.com/zhouxiuquan/p/3224685.html

    展开全文
  • 带时间的jQuery日期控件代码是一款基于jQueryUI实现的,可自定义日期插件语言,选择的时间可精确到分钟。
  • 带时间的jQuery日期控件代码是一款基于jQueryUI实现的,可自定义日期插件语言,选择的时间可精确到分钟。
  • 精确到秒的JQuery日期控件,jquery日历插件,jquery日期插件

    效果图如下:

    enter image description here

    首先在页面中引用一下库:

    <link type="text/css" href="css/jquery-ui-1.8.17.custom.css" rel="stylesheet" />
    <link type="text/css" href="css/jquery-ui-timepicker-addon.css" rel="stylesheet" />
    <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-timepicker-addon.js"></script>
    <script type="text/javascript" src="js/jquery-ui-timepicker-zh-CN.js"></script>
      汉化包代码:
    
    ?
    (function ($) {
        // 汉化 Datepicker
        $.datepicker.regional['zh-CN'] =
        {
            clearText: '清除', clearStatus: '清除已选日期',
            closeText: '关闭', closeStatus: '不改变当前选择',
            prevText: '<上月', prevStatus: '显示上月',
            nextText: '下月>', nextStatus: '显示下月',
            currentText: '今天', currentStatus: '显示本月',
            monthNames: ['一月', '二月', '三月', '四月', '五月', '六月',
            '七月', '八月', '九月', '十月', '十一月', '十二月'],
            monthNamesShort: ['一', '二', '三', '四', '五', '六',
            '七', '八', '九', '十', '十一', '十二'],
            monthStatus: '选择月份', yearStatus: '选择年份',
            weekHeader: '周', weekStatus: '年内周次',
            dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
            dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
            dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
            dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 d日, DD',
            dateFormat: 'yy-mm-dd', firstDay: 1,
            initStatus: '请选择日期', isRTL: false
        };
        $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
    
        //汉化 Timepicker
        $.timepicker.regional['zh-CN'] = {
            timeOnlyTitle: '选择时间',
            timeText: '时间',
            hourText: '小时',
            minuteText: '分钟',
            secondText: '秒钟',
            millisecText: '微秒',
            timezoneText: '时区',
            currentText: '现在时间',
            closeText: '关闭',
            timeFormat: 'hh:mm',
            amNames: ['AM', 'A'],
            pmNames: ['PM', 'P'],
            ampm: false
        };
        $.timepicker.setDefaults($.timepicker.regional['zh-CN']);
    })(jQuery);

      注:汉化的逻辑就是,设置“zh-CN”标签的语言包内容,然后设置默认语言为“zh-CN”。

    demo下载地址:精确到秒的JQuery日期控件.rar

    参数说明: Localization Options

    currentText
    Default: "Now", A Localization Setting - Text for the Now button.
    closeText
    Default: "Done", A Localization Setting - Text for the Close button.
    amNames
    Default: ['AM', 'A'], A Localization Setting - Array of strings to try and parse against to determine AM.
    pmNames
    Default: ['PM', 'P'], A Localization Setting - Array of strings to try and parse against to determine PM.
    timeFormat
    Default: "HH:mm", A Localization Setting - String of format tokens to be replaced with the time. See Formatting.
    timeSuffix
    Default: "", A Localization Setting - String to place after the formatted time.
    timeOnlyTitle
    Default: "Choose Time", A Localization Setting - Title of the wigit when using only timepicker.
    timeText
    Default: "Time", A Localization Setting - Label used within timepicker for the formatted time.
    hourText
    Default: "Hour", A Localization Setting - Label used to identify the hour slider.
    minuteText
    Default: "Minute", A Localization Setting - Label used to identify the minute slider.
    secondText
    Default: "Second", A Localization Setting - Label used to identify the second slider.
    millisecText
    Default: "Millisecond", A Localization Setting - Label used to identify the millisecond slider.
    microsecText
    Default: "Microsecond", A Localization Setting - Label used to identify the microsecond slider.
    timezoneText
    Default: "Timezone", A Localization Setting - Label used to identify the timezone slider.
    isRTL
    Default: false, A Localization Setting - Right to Left support.
    Alt Field Options
    
    altFieldTimeOnly
    Default: true - When altField is used from datepicker altField will only receive the formatted time and the original field only receives date.
    altSeparator
    Default: (separator option) - String placed between formatted date and formatted time in the altField.
    altTimeSuffix
    Default: (timeSuffix option) - String always placed after the formatted time in the altField.
    altTimeFormat
    Default: (timeFormat option) - The time format to use with the altField.
    Timezone Options
    
    timezoneList
    Default: [generated timezones] - An array of timezones used to populate the timezone select. Can be an array of values or an array of objects: { label: "EDT", value: -240 }. The value should be the offset number in minutes. So "-0400" which is the format "-hhmm", would equate to -240 minutes.
    Time Field Options
    
    controlType
    Default: 'slider' - Whether to use 'slider' or 'select'. If 'slider' is unavailable through jQueryUI, 'select' will be used. For advanced usage you may pass an object which implements "create", "options", "value" methods to use controls other than sliders or selects. See the _controls property in the source code for more details.
    {
        create: function(tp_inst, obj, unit, val, min, max, step){    
            // generate whatever controls you want here, just return obj
        },
        options: function(tp_inst, obj, unit, opts, val){
            // if val==undefined return the value, else return obj
        },
        value: function(tp_inst, obj, unit, val){
            // if val==undefined return the value, else return obj
        }
    }
    showHour
    Default: null - Whether to show the hour control. The default of null will use detection from timeFormat.
    showMinute
    Default: null - Whether to show the minute control. The default of null will use detection from timeFormat.
    showSecond
    Default: null - Whether to show the second control. The default of null will use detection from timeFormat.
    showMillisec
    Default: null - Whether to show the millisecond control. The default of null will use detection from timeFormat.
    showMicrosec
    Default: null - Whether to show the microsecond control. The default of null will use detection from timeFormat.
    showTimezone
    Default: null - Whether to show the timezone select.
    showTime
    Default: true - Whether to show the time selected within the datetimepicker.
    stepHour
    Default: 1 - Hours per step the slider makes.
    stepMinute
    Default: 1 - Minutes per step the slider makes.
    stepSecond
    Default: 1 - Seconds per step the slider makes.
    stepMillisec
    Default: 1 - Milliseconds per step the slider makes.
    stepMicrosec
    Default: 1 - Microseconds per step the slider makes.
    hour
    Default: 0 - Initial hour set.
    minute
    Default: 0 - Initial minute set.
    second
    Default: 0 - Initial second set.
    millisec
    Default: 0 - Initial millisecond set.
    microsec
    Default: 0 - Initial microsecond set. Note: Javascript's native Date object does not natively support microseconds. Timepicker adds ability to simply Date.setMicroseconds(m) and Date.getMicroseconds(). Date comparisons will not acknowledge microseconds. Use this only for display purposes.
    timezone
    Default: null - Initial timezone set. This is the offset in minutes. If null the browser's local timezone will be used. If you're timezone is "-0400" you would use -240. For backwards compatibility you may pass "-0400", however the timezone is stored in minutes and more reliable.
    hourMin
    Default: 0 - The minimum hour allowed for all dates.
    minuteMin
    Default: 0 - The minimum minute allowed for all dates.
    secondMin
    Default: 0 - The minimum second allowed for all dates.
    millisecMin
    Default: 0 - The minimum millisecond allowed for all dates.
    microsecMin
    Default: 0 - The minimum microsecond allowed for all dates.
    hourMax
    Default: 23 - The maximum hour allowed for all dates.
    minuteMax
    Default: 59 - The maximum minute allowed for all dates.
    secondMax
    Default: 59 - The maximum second allowed for all dates.
    millisecMax
    Default: 999 - The maximum millisecond allowed for all dates.
    microsecMax
    Default: 999 - The maximum microsecond allowed for all dates.
    hourGrid
    Default: 0 - When greater than 0 a label grid will be generated under the slider. This number represents the units (in hours) between labels.
    minuteGrid
    Default: 0 - When greater than 0 a label grid will be generated under the slider. This number represents the units (in minutes) between labels.
    secondGrid
    Default: 0 - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in seconds) between labels.
    millisecGrid
    Default: 0 - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in milliseconds) between labels.
    microsecGrid
    Default: 0 - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in microseconds) between labels.
    Other Options
    
    showButtonPanel
    Default: true - Whether to show the button panel at the bottom. This is generally needed.
    timeOnly
    Default: false - Hide the datepicker and only provide a time interface.
    onSelect
    Default: null - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).
    alwaysSetTime
    Default: true - Always have a time set internally, even before user has chosen one.
    separator
    Default: " " - When formatting the time this string is placed between the formatted date and formatted time.
    pickerTimeFormat
    Default: (timeFormat option) - How to format the time displayed within the timepicker.
    pickerTimeSuffix
    Default: (timeSuffix option) - String to place after the formatted time within the timepicker.
    showTimepicker
    Default: true - Whether to show the timepicker within the datepicker.
    addSliderAccess
    Default: false - Adds the sliderAccess plugin to sliders within timepicker
    sliderAccessArgs
    Default: null - Object to pass to sliderAccess when used.
    defaultValue
    Default: null - String of the default time value placed in the input on focus when the input is empty.
    minDateTime
    Default: null - Date object of the minimum datetime allowed. Also available as minDate.
    maxDateTime
    Default: null - Date object of the maximum datetime allowed. Also Available as maxDate.
    parse
    Default: 'strict' - How to parse the time string. Two methods are provided: 'strict' which must match the timeFormat exactly, and 'loose' which uses javascript's new Date(timeString) to guess the time. You may also pass in a function(timeFormat, timeString, options) to handle the parsing yourself, returning a simple object:

    更多参数设置请参考:http://trentrichardson.com/examples/timepicker/


    转载自:http://www.9958.pw/post/jquery_timepicker

    展开全文

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,205
精华内容 482
关键字:

jquery日期控件