JavaScript Special Calendar control sharing _javascript Tips

Source: Internet
Author: User
Tags set time

This article for everyone to share a cool JS Calendar control, for everyone's reference, the specific contents are as follows

Reference jslit.js download Jslite.io, compatible jslite and JQuery

Installation method

Page reference Jslite or jquery

<div id= "JSLITECALENBAR4" ><input type= "text" ></div> <script type= "Text/javascript" src= "
. /jslite.js "></script>
<script type=" Text/javascript "src=" JSLite.Calendar.js "></script>
<script type= "Text/javascript" >
 var obj4 = document.getElementById ("JSLITECALENBAR4")
 var cal= New $.calendar ($ ("#JSLiteCalenbar4") [0],function (date) {
  console.log (date);
  Returns the time value of the change date=2014-10-11
  $ (' #JSLiteCalenbar4 input '). Val ()
  This.calBoxs.prev (). Val (date)
 })
 . Hide ()
 . Time ("YYYY/MM DD day hh:mm:ss", ' Default ')
 Console.log (CAL);
</script>

Extension methods

    • HIDEPREVBTN: Hide the previous page button to show the future time, can not read history
    • Hide: Click on the Display interface
    • Setdate: Set time, pass JSON
    • Time: Set whether the option is available (hours) "YYYY/MM month DD Day HH:MM:SS" serial number time format ' default ' defaults to the default and the time specified

Hide

Click on the Display interface

<div id= "JSLiteCalenbar2" ><div class= "" > click Show </div></div>
<script type= "text/ JavaScript ">
 var obj3 = document.getElementById (" JSLiteCalenbar2 ")
 new $.calendar (obj3,{
  " Now ":" 2014-09-15 "
 },function (date) {
  //Returns the changed time value date=2014-10-11
  console.log (date)
 }). Hide ();
</script>

Example One

var obj3 = document.getElementById ("JSLiteCalenbar2")
new Jslite.calendar (obj3,{
 "Now": "2014-09-15"

}, function (date) {
 //returns the value of the change date=2014-10-11
 console.log (date)
 console.log ("Obj3")
}). Time ("yyyy/ MM month DD Day Hh:mm:ss ", ' Default ');



var cal = new Jslite.calendar (Obj,function () {
  "now": "2014-09-15",//server current time
  "Change": true,// Do you want to change the content
  "Interfacenum" before the current time: 3,//shows how many Calendar "Workdate" are currently in the future
  : [
   {
    "date": "2013-12",
    "Day": [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "Ten", "},{"]
    "date": "2014-09",
    "Day": ["10", "2", "3", "4", "5", "6", "a"] 
   },{
    "date": "2014-05", "Day
    ": ["Ten", "2", "3", "4", "5", "6", "a"] 
   },{
    "date": "2014-10",
    "Day": ["2", "3", "4", "5", "6", "M" 
   }
  ]
 }
},function (date) {
 / Returns the time value of the change date=["2014-10-10,0", "2014-10-11,0"]
 console.log (date)
). HIDEPREVBTN ()

Example Two

var obj3 = document.getElementById ("JSLiteCalenbar2")
new Jslite.calendar (obj3,function (date) {
 // Returns the time value of the change date=2014-10-11
 console.log (date)
 console.log ("Obj3")
}). hideprevbtn (). Hide ()

The above is the entire content of this article, I hope to help you learn.

Related Article

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.