{"id":33091170,"url":"https://github.com/fugm/PriceCalendar","last_synced_at":"2025-11-16T14:00:40.994Z","repository":{"id":4391425,"uuid":"5528438","full_name":"fugm/PriceCalendar","owner":"fugm","description":"酒店价格日历","archived":false,"fork":false,"pushed_at":"2012-08-25T03:33:40.000Z","size":102,"stargazers_count":47,"open_issues_count":0,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-06T02:32:35.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/fugm.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}},"created_at":"2012-08-23T15:34:13.000Z","updated_at":"2022-05-23T08:57:49.000Z","dependencies_parsed_at":"2022-09-17T17:13:02.807Z","dependency_job_id":null,"html_url":"https://github.com/fugm/PriceCalendar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fugm/PriceCalendar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugm%2FPriceCalendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugm%2FPriceCalendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugm%2FPriceCalendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugm%2FPriceCalendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fugm","download_url":"https://codeload.github.com/fugm/PriceCalendar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugm%2FPriceCalendar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284719042,"owners_count":27052182,"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","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-14T18:00:23.169Z","updated_at":"2025-11-16T14:00:40.989Z","avatar_url":"https://github.com/fugm.png","language":"JavaScript","readme":"#酒店价格日历\n\n####基于YUI3开发的价格日历组件\n\n\t@name：Y.PriceCalendar\n\t@requires：['node', 'base-base', 'event-mouseenter']\n\t\n##快速上手\n\n####引入文件\n\n在页面head引入YUI3.x.x种子\n\n`\u003cscript src=\"http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js\"\u003e\u003c/script\u003e`\n\n####配置\n\n```\nvar config = {\n    modules: {\n        'price-calendar': {\n            fullpath: 'price-calendar.js', //根据项目路径调整\n            type    : 'js',\n            requires: ['price-calendar-css']\n        },\n        'price-calendar-css': {\n            fullpath: 'price-calendar.css', //根据项目路径调整\n            type    : 'css'\n        }\n    }\n};\n```\n\n####使用\n\n```\nYUI(config).use('price-calendar', function(Y) {\n    var oCalendar = new Y.PriceCalendar();    \n    //do something\n});\n```\n\n##配置参数\n\n* ####date\n\n\t\u003e **概述**\n\t\u003e \n\t\u003e *(默认值：当前日期) 日历初始日期*\n\t\u003e\n\t\u003e **类型**\n\t\u003e\n\t\u003e `{Date|String}`\n\t\n* ####data\n\n    \u003e **概述**\n\t\u003e \n\t\u003e *(默认值：null) 酒店房态数据*\n\t\u003e\n\t\u003e **类型**\n\t\u003e\n\t\u003e `{Object}`\n\t\n\t```\n\t{\n    \t\"2012-05-01\": {\n    \t\t\"price\"  : \"100\",\n        \t\"roomNum\": \"10\"\n    \t},\n    \t\"2012-05-02\": {\n        \t\"price\"  : \"120\",\n        \t\"roomNum\": \"1\"\n   \t \t},\n    \t\"2012-05-03\": {\n     \t   \"price\"  : \"150\",\n     \t   \"roomNum\": \"25\"\n    \t}\n    }\n\t```\n\t\n* ####count\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *(默认值：2) 日历个数*\n\t\u003e\n\t\u003e **类型**\n\t\u003e\n\t\u003e `{Number}`\n\t\n* ####minDate\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *(默认值：null) 允许操作的最小日期*\n\t\u003e\n\t\u003e **类型**\n\t\u003e\n\t\u003e `{Date|String}`\n\t\n* ####maxDate\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *(默认值：null) 允许操作的最大日期*\n\t\u003e\n\t\u003e **类型**\n\t\u003e\n\t\u003e `{Date|String}`\n\t\n* ####depDate\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *(默认值：空) 入住时间*\n\t\u003e\n\t\u003e **类型**\n\t\u003e\n\t\u003e `{String}`\n\t\n* ####endDate\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *(默认值：空) 离店时间*\n\t\u003e\n\t\u003e **类型**\n\t\u003e\n\t\u003e `{String}`\n\t\n* ####afterDays\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *(默认值：0) 等价于设置minDate和maxDate，minDate未设置时取当前日期*\n\t\u003e\n\t\u003e **类型**\n\t\u003e\n\t\u003e `{Number}`\n\t\n##接口\n\t\n* ####`render()`\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *用于设置参数后渲染日历UI*\n\t\u003e\n\t\u003e **返回值**\n\t\u003e\n\t\u003e *日历对象，可做链式操作*\n\t\n* ####`prevMonth()`\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *渲染上月日历UI*\n\t\u003e\n\t\u003e **返回值**\n\t\u003e\n\t\u003e *日历对象，可做链式操作*\n\t\n* ####`nextMonth()`\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *渲染下月日历UI*\n\t\u003e\n\t\u003e **返回值**\n\t\u003e\n\t\u003e *日历对象，可做链式操作*\n\n##自定义事件\n\n* ####render\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *渲染日历UI事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('render', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####prevmonth\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *点击上月按钮事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('prevmonth', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####nextmonth\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *点击下月按钮事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('nextmonth', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####checkin\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *点击入住日期事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('checkin', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####checkout\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *点击离店日期事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('checkout', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####confirm\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *点击确定按钮事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('confirm', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####cancel\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *点击取消按钮事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('cancel', function(e) {\n        \t//do something\n    \t});\n\t```\n\n##配置参数改变事件\n\n* ####dateChange\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *设置`date`参数触发事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('dateChange', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####dataChange\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *设置`data`参数触发事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('dataChange', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####countChange\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *设置`count`参数触发事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('countChange', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####minDateChange\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *设置`minDate`参数触发事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('minDateChange', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####maxDateChange\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *设置`maxDate`参数触发事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('maxDateChange', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####depDateChange\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *设置`depDate`参数触发事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('depDateChange', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####endDateChange\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *设置`endDate`参数触发事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('endDateChange', function(e) {\n        \t//do something\n    \t});\n\t```\n\n* ####afterDaysChange\n\n\t\u003e **概述**\n\t\u003e\n\t\u003e *设置`afterDays`参数触发事件*\n\t\u003e\n\t\u003e **示例**\n\t\n\t```\n\tvar oCalendar = new Y.PriceCalendar();\n    \toCalendar.on('afterDaysChange', function(e) {\n        \t//do something\n    \t});\n\t```","funding_links":[],"categories":["10. 表单处理"],"sub_categories":["10.5 日期选择 ###","10.6 日期选择"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffugm%2FPriceCalendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffugm%2FPriceCalendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffugm%2FPriceCalendar/lists"}