{"id":13397881,"url":"https://github.com/rykdesjardins/js-calendar","last_synced_at":"2026-02-22T03:01:04.930Z","repository":{"id":57390682,"uuid":"95394520","full_name":"rykdesjardins/js-calendar","owner":"rykdesjardins","description":"The lightest Javascript calendar out there, without any dependency.","archived":false,"fork":false,"pushed_at":"2018-08-28T02:33:32.000Z","size":196,"stargazers_count":33,"open_issues_count":9,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-23T12:46:27.194Z","etag":null,"topics":["calendar","date","javascript","javascript-widget-library","no-dependencies","vanilla-javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rykdesjardins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-26T00:48:54.000Z","updated_at":"2025-12-18T12:59:22.000Z","dependencies_parsed_at":"2022-08-30T20:01:09.072Z","dependency_job_id":null,"html_url":"https://github.com/rykdesjardins/js-calendar","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rykdesjardins/js-calendar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rykdesjardins%2Fjs-calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rykdesjardins%2Fjs-calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rykdesjardins%2Fjs-calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rykdesjardins%2Fjs-calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rykdesjardins","download_url":"https://codeload.github.com/rykdesjardins/js-calendar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rykdesjardins%2Fjs-calendar/sbom","scorecard":{"id":792882,"data":{"date":"2025-08-11","repo":{"name":"github.com/rykdesjardins/js-calendar","commit":"7e048b2951d3eb00a2a71308667d9412adea6a20"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T08:04:02.922Z","repository_id":57390682,"created_at":"2025-08-23T08:04:02.922Z","updated_at":"2025-08-23T08:04:02.922Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29704400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"online","status_checked_at":"2026-02-22T02:00:08.193Z","response_time":110,"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":["calendar","date","javascript","javascript-widget-library","no-dependencies","vanilla-javascript"],"created_at":"2024-07-30T18:01:50.901Z","updated_at":"2026-02-22T03:01:04.905Z","avatar_url":"https://github.com/rykdesjardins.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# JSCalendar\nThe lightest Javascript calendar out there, without any dependency (no jQuery). This is a work in progress, but it is ready to be used in production.\n\nThe development files are using es2016, so I used babel with the es2015 preset and babily to minify the whole thing. Distribution files can be found under `./dist/`. There are both normal and minified files. \n\n## Sailor's honour\nIf other kind developers want to lend a hand, I will obviously stop pushing directly to master and switch to a dev branch ;)\n\nEDIT : This now has a dev branch. Thanks to @jamacon36, I will probably be maintaining this library again. \n\n## Installation\n### Using git \n`git clone https://github.com/rykdesjardins/js-calendar`\n\n### Using NPM \n`npm install --save vanilla-js-calendar`\n\n### Using bower \n`bower install --save vanilla-js-calendar`\n\n## Basic usage\n```javascript \nvar elem = document.getElementById(\"myCalendar\");\nvar calendar = new JSCalendar(elem, { /* options */ }).init().render();\n```\n\n# Imported Usage\n```javascript\nimport * as LibName from \"vanilla-js-calendar\"\n\nvar elem = document.getElementById(\"myCalendar\");\nvar JSCalendar = LibName.JSCalendar;\nvar JSCalendarEvent = LibName.JSCalendarEvent;\nvar calendar = new JSCalendar(elem, { /* options */ }).init().render();\n```\n\n## Latest tag\n1.0.10\n\n## Simple design and fast rendering\n![demoscreenshot](https://erikdesjardins.com/static/git/jscalendar-ss-month.jpg \"Screenshot of provided demo in example.html\")\n\n## Options\n| Option name | Usage | Default |\n| ----------- | ----- | ------- |\n| views | Array of available views | [\"day\", \"week\", \"month\"] |\n| viewsVocab | Object of words used to represent the views { view : \"display name\" } | {day : \"Day\", week : \"Week\", month : \"Month\" } |\n| buttons | Available buttons in the top control bar | [\"previous\", \"today\", \"next\"] |\n| buttonsActions | JSCalendar function, or user-defined function object for top buttons { action : \"functionName\" \\|\\| function } | { previous : \"goBack\", today : \"goNow\", next : \"goNext\" } |\n| buttonsVocab | Object of words used to represent the buttons { action : \"display name\" } | {previous : \"\u003c\", today : \"Today\", next : \"\u003e\"} |\n| monthsVocab | Array of display names for every months | [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"] |\n| daysVocab | Array of display names for every week day | [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"] |\n| emptyDayVocab | Display phrase when no event is found for a partical day | \"Nothing here.\" |\n| noDate | Word used when an event has no time at a certain date | \"Somewhen\" |\n| nonameEventVocab | Words used when an event does not have a name | \"Event without a name\" |\n| globalSelector | Query Selector used to search for JSCalendars in the DOM | \".js-calendar\" |\n| eventBackground | Default event background color | \"rgb(126, 156, 193)\" |\n| titleCropSize | Number of letter max for events in the month view | 20 |\n| datasource | URL used to request matrix data | \"\" |\n| datasourceHeaders | Headers to be sent to the data source on every request | {} |\n| ampm | Flag, setting it to true will use 12h system, false will use 24h | true |\n| displaySeconds | Flag, setting it to true will display the seconds for the events in the calendar | false |\n| dayviewGapMinutes | Number of minutes between each block in day view | 30 |\n| dayviewNoTimeGapSize | Number of block used in day view for events without a time | 2 |\n| alwaysFetch | Wether to always fetch from server or not | false |\n| fetchReplaces | Wether to replace the entire matrix after fetching, false for append | false |\n| dayviewGapHeight | Height of a block in day view, in pixels | 38 |\n| height | Maximum height for the calendar, if it goes beyond, scroll bars are added | 700 |\n| width | Maximum width for the calendar, if it goes beyond, the rest will be hidden. Can also be \"full\" for responsive full width. | 1024 |\n\n## Hooks\nHooks can be used to customize certain events and alter the way data is fetched, processed and rendered. \n\n```javascript\n// Hooks on a specific instance\nvar calendarInstance = new JSCalendar(elem);\ncalendarInstance.on('eventName', (calendar, extra) =\u003e {\n    // calendar is the current calendar instance\n    // extra contains various data depending on the event\n});\n\n// Hooks on all instances\nJSCalendar.on('eventName', (calendar, extra) =\u003e {\n    // Arguments are the same as above\n});\n```\n\n| Hook name | Context |\n| --------- | ------- |\n| new | Fired when a JSCalendar object is built using the default constructor. |\n| init | Fired when the initialization logic is being processed for a newly built object. Fired before the DOM structure is created. | \n| willPush | Fired before adding an item to the calendar dynamically. |\n| pushed | Fired after adding an item to the calendar dynamically. |\n| didNotPush | Fired after failing to add an item to the calendar dynamically. |\n| willRender | Fired before rendering the calendar, also before fetching data from the data source if specified. |\n| rendered | Fired after the render logic was processed. |\n| dragging | Fired when an event is grabbed and ready to be moved around. |\n| dropped | Fired when an event is dropped, the event cellMightMove will be triggered right after this one. |\n| cellMightMove | Fired when a cell movement is validated. |\n| cellMoved | Fired after an event was moved from a cell to another. |\n| cellDidNotMoved | Fired when a cell could have moved, but the validation failed or the event was dropped onto its original cell. |\n| matrixWillSet | Fired when a matrix is sent to replace the current one in the calendar's state. |\n| matrixSet | Fired after a matrix was set as the current matrix state. |\n| matrixWillAppend | Fired when another matrix is about to be inserted into the current matrix state |\n| matrixAppended | Fired after another matrix was inserted into the current matrix state |\n| willFetch | Fired before sending a fetch request to a data source. |\n| fetched | Fired after receiving data from the data source. |\n| viewWillChange | Fired before rendering a new view (month, week, day). |\n| viewChanged | Fired after changing view. This will not fire if the view was set to the current one (wasn't changed). |\n\n## Static functions\nThose can be called using the class directly\n```javascript\n// Will instanciate all calendars found under a certain wrapper\nJSCalendar.find(document.getElementById(\"calendar-area\"));\n\n// Will return an instance of a calendar automatically generated using JSCalendar.find()\nJSCalendar.getInstance(instanceid);\n\n// Fires an event to all calendars from a specified instance\nJSCalendar.fire(event, instance, extra);\n\n/* \n    Returns an object : \n    { \n        numberOfDays : number,  // Total number of days in the month\n        firstDay : number       // Week day of the 1st of the month\n    }\n*/\nJSCalendar.getDaysInMonth(year, month);\n```\n\n## Instance functions\nAssociated with all JSCalendar instanciated objects. Chainable functions return \"this\" so you can chain multiple functions on one line.\n```javascript\n// Must be called after instanciating [chainable]\ncalendar.init(callback)\n\n// Previous, today, next [chainable]\n// Those are called when pressing the direction buttons on the top bar. \n// The calendar will be rendered at the end\ncalendar.goBack();\ncalendar.goNow();\ncalendar.goNext();\n\n// Adding an item to the matrix [chainable]\n/*\n    The first parameter is an object : \n    {\n        at : Date,\n        event : JSCalendarEventTemplate { \n            at : Date, \n            displayname : string, \n            duration : number,  \n            color : string\n        }\n    }\n*/\ncalendar.push(event);\n\n// Destroy calendar reference [chainable]\ncalendar.destroy();\n\n// Switch from current view to another [chainable]\n/*\n    First parameter is on of the following strings : \n        month\n        week\n        day\n*/\ncalendar.setView(view);\n\n// Refresh and rebuild current view [chainable]\ncalendar.render();\n\n// Merge a new matrix into the current state matrix [chainable]\n/*\n    A matrix is an object formatted like the following :\n    matrix[year][month][day] = [JSCalendarEventTemplate];\n    \n    The second parameter is a flag (true|false). If true, \n    the calendar will render after setting the new matrix\n*/\ncalendar.appendMatrix(matrix, rerender);\n\n// Set the current state matrix, and destroy the old one if any [chainable]\ncalendar.setMatrix(matrix, rerender);\n\n// If a data source is specified, fetch a new matrix to append [chainable]\n/*\n    This will request to the data source specified with query parameters\n    like the following : \n    year = current state year\n    month = current state month\n    day = current state day\n    \n    Once finished, the provided callback will be executed\n    The second parameter is a flag (true|false), if set to true, will\n    fetch even is a cached version of the matrix exists.\n*/\ncalendar.fetch(callback, force);\n```\n\n## More screenshots\n\n### No conflicts with overlapping events\n![demoscreenshot](https://erikdesjardins.com/static/git/jscalendar-ss-day.jpg \"Screenshot of provided demo in example.html\")\n\n### Week view\n![demoscreenshot](https://erikdesjardins.com/static/git/jscalendar-ss-week.jpg \"Screenshot of provided demo in example.html\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frykdesjardins%2Fjs-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frykdesjardins%2Fjs-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frykdesjardins%2Fjs-calendar/lists"}