Code Monkey home page Code Monkey logo

cxcalendar's Introduction

#jQuery cxCalendar

cxCalendar 是基于 jQuery 的日期选择器插件

版本:

  • jQuery v1.4.4+
  • jQuery cxCalendar v1.2

文档:http://code.ciaoca.com/jquery/cxcalendar/

示例:http://code.ciaoca.com/jquery/cxcalendar/demo/

##【options 参数说明】

名称 默认值 说明
beginyear 1950 起始年份
endyear 2030 结束年份
date new Date()

默认日期。默认使用 javascript 获取当前日期,自定义需使用字符串。日期格式和 type 相同。

※ input 中的 value 值优先级要高级此值。

type "yyyy-mm-dd" 日期格式。可设置为:"yyyy-mm-dd" | "yyyy-m-d"
hyphen "-" 日期连接符。可设置为:"-" | "/" | "."
wday 0 周第一天。可设置为:0-6 之间的数字。

0=星期日

1=星期一

2=星期二

3=星期三

4=星期四

5=星期五

6=星期六

##【data 属性参数】

名称 说明
data-beginyear 起始年份
data-endyear 结束年份
data-type 日期格式。可设置为:"yyyy-mm-dd" | "yyyy-m-d"
data-hyphen 日期连接符。可设置为:"-" | "/" | "."
data-wday 周第一天。可设置为:0-6 之间的数字。
```html ``` ※ data 属性设置的参数优先级要高于 options 设置的值

##【language 语言配置说明】

名称 默认值 说明
year "年"
month "月"
month_list ["1","2","3","4","5","6","7","8","9","10","11","12"] 月份名称。
week_list ["日","一","二","三","四","五","六"] 星期名称。从星期日开始排序

##【使用方法】

###载入 CSS 文件

<link rel="stylesheet" href="css/jquery.cxcalendar.css">

###载入 JavaScript 文件

<script src="js/jquery.js"></script>
<script src="js/jquery.cxcalendar.js"></script>

###调用 cxCalendar

// 直接调用
$("#element_id").cxCalendar()

// 自定义参数调用
$("#element_id").cxCalendar({
    beginyear:1950,
    endyear:2030,
    date:"1988/1/31",
    type:"yyyy-mm-dd",
    hyphen:"-",
    wday:0
});

// 设置全局默认值,需在引入 <script src="js/jquery.cxselect.js"></script> 之后,调用之前设置
$.cxCalendar.defaults.begin_year=1970;
$.cxCalendar.language={
    year:"",
    month:"",
    monthList:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],
    weekList:["Sun","Mon","Tur","Wed","Thu","Fri","Sat"]
};

cxcalendar's People

Contributors

ciaoca avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.