{"id":26065811,"url":"https://github.com/jslite/calendar","last_synced_at":"2025-07-13T01:10:41.792Z","repository":{"id":86000196,"uuid":"53212986","full_name":"JSLite/calendar","owner":"JSLite","description":":date: 日历控件","archived":false,"fork":false,"pushed_at":"2016-03-25T04:25:34.000Z","size":113,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T11:11:17.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JSLite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-03-05T17:12:45.000Z","updated_at":"2018-09-13T14:07:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cb4ef92-ecde-4116-9dcc-bfe2d11609a9","html_url":"https://github.com/JSLite/calendar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSLite%2Fcalendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSLite%2Fcalendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSLite%2Fcalendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSLite%2Fcalendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JSLite","download_url":"https://codeload.github.com/JSLite/calendar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429056,"owners_count":21101779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-08T19:36:07.255Z","updated_at":"2025-04-11T15:04:20.419Z","avatar_url":"https://github.com/JSLite.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 日历控件\n\n[![](http://jaywcjlove.github.io/sb/plugin/jslite.svg)](https://github.com/JSLite/JSLite) [![](http://jaywcjlove.github.io/sb/ico/segmentfault.svg)](https://segmentfault.com/t/jslite) [![](http://jaywcjlove.github.io/sb/ico/gulp-build-with.svg)](https://segmentfault.com/t/jslite)\n\n\u003e 引用JSLit.js 下载 [JSLite.io](http://JSlite.io)，兼容 `JSLite` 和 `jQuery`\n\n![日历控件](https://raw.githubusercontent.com/JSLite/calendar/master/calendar.gif \"日历控件\")  \n![日历控件](https://raw.githubusercontent.com/JSLite/calendar/master/calendar2.gif \"日历控件\")  \n\n## 安装方法\n\n页面引用 `JSLite` 或者`jQuery`  \n\n\n```html \n\u003cdiv id=\"JSLiteCalenbar4\"\u003e\u003cinput type=\"text\"\u003e\u003c/div\u003e\n\u003cscript type=\"text/javascript\" src=\"../JSLite.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"JSLite.Calendar.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\"\u003e\n    var obj4 = document.getElementById(\"JSLiteCalenbar4\")\n    var cal=new $.calendar($(\"#JSLiteCalenbar4\")[0],function(date){\n        console.log(date);\n        //返回更改的时间值date=2014-10-11\n        $('#JSLiteCalenbar4 input').val()\n        this.calBoxs.prev().val(date)\n    })\n    .hide()\n    .time(\"yyyy/MM月dd日 hh:mm:ss\",'default')\n    console.log(cal);\n\u003c/script\u003e\n```\n\n# 扩展方法 \n\n- `hidePrevBtn`:隐藏上一页 按钮 显示未来时间，不能翻阅历史\n- `hide`:点击显示界面  \n- `setDate`:设置时间，传json\n- `time`:设置是否可以选则时间 (时分) \n    \"yyyy/MM月dd日 hh:mm:ss\" 序列号时间格式\n    'default' 默认再`input`中显示默认时间或者指定时间\n\n## hide \n\n\u003e 点击显示界面\n\n```html\n\u003cdiv id=\"JSLiteCalenbar2\"\u003e\u003cdiv class=\"\"\u003e点击显示\u003c/div\u003e\u003c/div\u003e\n\u003cscript type=\"text/javascript\"\u003e\n    var obj3 = document.getElementById(\"JSLiteCalenbar2\")\n    new $.calendar(obj3,{\n        \"now\":\"2014-09-15\"\n    },function(date){\n        //返回更改的时间值date=2014-10-11\n        console.log(date)\n    }).hide();\n\u003c/script\u003e\n```\n\n## 例子一\n\n```js\nvar obj3 = document.getElementById(\"JSLiteCalenbar2\")\nnew JSLite.calendar(obj3,{\n    \"now\":\"2014-09-15\"\n    \n},function(date){\n    //返回更改的时间值date=2014-10-11\n    console.log(date)\n    console.log(\"obj3\")\n}).time(\"yyyy/MM月dd日 hh:mm:ss\",'default');\n \n \n \nvar cal = new JSLite.calendar(obj,function(){\n    return {\n        \"now\":\"2014-09-15\",//服务器当前时间\n        \"change\":true,//是否更改当前时间以前的内容\n        \"interfaceNum\":3,//显示当前以后多少个日历\n        \"workdate\":[\n            {\n                \"date\":\"2013-12\",\n                \"day\":[\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"20\"] \n            },{\n                \"date\":\"2014-09\",\n                \"day\":[\"10\", \"2\", \"3\", \"4\", \"5\", \"6\", \"20\"] \n            },{\n                \"date\":\"2014-05\",\n                \"day\":[\"10\", \"2\", \"3\", \"4\", \"5\", \"6\", \"20\"] \n            },{\n                \"date\":\"2014-10\",\n                \"day\":[\"12\", \"2\", \"3\", \"4\", \"5\", \"6\", \"20\"] \n            }\n        ]\n    }\n},function(date){\n    //返回更改的时间值date=[\"2014-10-10,0\",\"2014-10-11,0\"]\n    console.log(date)\n}).hidePrevBtn()\n```\n\n## 例子二\n\n```js\nvar obj3 = document.getElementById(\"JSLiteCalenbar2\")\nnew JSLite.calendar(obj3,function(date){\n    //返回更改的时间值date=2014-10-11\n    console.log(date)\n    console.log(\"obj3\")\n}).hidePrevBtn().hide()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjslite%2Fcalendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjslite%2Fcalendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjslite%2Fcalendar/lists"}