{"id":16062165,"url":"https://github.com/rossta/montrose-select","last_synced_at":"2025-02-23T01:15:14.566Z","repository":{"id":54718349,"uuid":"76498854","full_name":"rossta/montrose-select","owner":"rossta","description":"a javascript menu for selecting repeating events","archived":false,"fork":false,"pushed_at":"2016-12-16T23:11:30.000Z","size":266,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-15T10:57:02.293Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rossta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-14T21:34:27.000Z","updated_at":"2017-10-29T23:53:37.000Z","dependencies_parsed_at":"2022-08-14T00:40:53.964Z","dependency_job_id":null,"html_url":"https://github.com/rossta/montrose-select","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/rossta%2Fmontrose-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fmontrose-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fmontrose-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fmontrose-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rossta","download_url":"https://codeload.github.com/rossta/montrose-select/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240254293,"owners_count":19772393,"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":"2024-10-09T04:22:15.764Z","updated_at":"2025-02-23T01:15:14.536Z","avatar_url":"https://github.com/rossta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# montrose-select\n\n[![Build Status](https://travis-ci.org/rossta/montrose-select.svg?branch=master)](https://travis-ci.org/rossta/montrose-select)\n\nA javascript menu for setting event recurrence, like Google Calendar events\n\nBuilt to integrate with the [`montrose`](https://github.com/rossta/montrose) ruby gem\nthrough the [`montrose-rails`](https://github.com/rossta/montrose-rails) Rails\nengine for handling event recurrences on the backend. Flexible enough to be used\nin other contexts.\n\n![](screenshot.png)\n\n## Installation\n\nVia NPM\n\n```ruby\nnpm install montrose-select\n```\n\nOr in the browser\n\n```javascript\n\u003cscript src=\"https://unpkg.com/montrose-select\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nGiven a form:\n\n```html\n\u003cform\u003e\n  \u003clabel data-recurrence=\"label\"\u003eRepeats on\u003c/label\u003e\n  \u003cinput data-recurrence=\"input\" type=\"hidden\" name=\"recurrence\"\u003e\n\u003c/form\u003e\n```\n\n```javascript\nimport MontroseSelect from 'montrose-select'\n\nnew MontroseSelect({\n  // Replaces targeted DOM element\n  target: document.querySelector('[data-recurrence=\"label\"]'),\n\n  // initial recurrence value\n  recurrence: null,\n\n  // Callback when recurrence changes\n  onChange: (recurrence) =\u003e {\n    console.log('Recurrence changed', recurrence)\n  },\n\n  // Callback when recurrence editing is \"done\"\n  onFinish: (recurrence) =\u003e {\n    document.querySelector('[data-recurrence=\"input\"]').value = JSON.stringify(recurrence)\n  },\n})\n```\n\nThe recurrence is a JavaScript object with the following properties:\n\n```javascript\n{\n  // specifies units; 'day' | 'week' | 'month' | 'year';\n  // required\n  frequency: 'day',\n\n  // specify unit count; any integer; defaults to 1;\n  // optional\n  interval: 2,\n\n  // when recurrence starts; an ISO-string or Date object;\n  // optional\n  starts: '2016-12-01',\n\n  // when recurrence ends by date; same as 'starts';\n  // optional\n  until: '2016-12-31',\n\n  // when recurrence ends by count; instead of 'until';\n  // optional\n  total: 10,\n\n  // specify day of week for weekly recurrence;\n  // [0-6] for Sunday-Saturday; optional\n  day: [0, 3, 6],\n}\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/rossta/montrose-select. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossta%2Fmontrose-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frossta%2Fmontrose-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossta%2Fmontrose-select/lists"}