Calendar (calendars)

Source: Internet
Author: User

This lesson focuses on the use of the Canlendar (Calendar) component in Easyui, which does not depend on its
His component.
A Load mode
Class Load Mode
<div id= "box" class= "Easyui-calendar"
Style= "width:200px;height:200px;" ></div>
JS Load Call
$ (' #box '). Calendar ({
});

Two Property List

property settings
$ (' #box '). Calendar ({
WIDTH:200,
HEIGHT:200,
Fit:false,
Border:false,
firstday:0,
Weeks: [' s ', ' M ', ' t ', ' W ', ' t ', ' F ', ' s '],
Months: [' Jan ', ' Feb ', ' Mar ', ' Apr ', ' may ', ' June ', ' Jul ', ' April ',
' Sep ', ' Oct ', ' Nov ', ' Dec ',
year:2012,
Month:6,
Current:new Date (2014,7,1),
Formatter:function (date) {
Return ' # ' + date.getdate ();
},
Styler:function (date) {
if (date.getday () = = 1) {
Return ' Background-color: #ccc ';
}
},
Validator:function (date) {
if (date.getday () = = 1) {
return true;
} else {
return false;
}
},
});

Three Event List

Event List
$ (' #box '). Calendar ({
Onselect:function (date) {
Alert (date.getfullyear () + ":" + (Date.getmonth () + 1) + ":"
+ date.getdate ());
},


Onchange:function (Newdate, olddate) {
Alert (newdate + ' | ' + olddate);
},
});

Four Method List

Return Property Object
Console.log ($ (' #box '). Calendar (' options '));
Adjust the calendar size
$ (' #box '). Calendar (' resize ');
Move to a specified date
$ (' #box '). Calendar (' MoveTo ', New Date (2015,1,1));
PS: We can use $.fn.calendar.defaults to override the default value object.

Calendar (calendars)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.