{"id":22705702,"url":"https://github.com/tox82/flatpickr-fastselect","last_synced_at":"2025-03-29T20:25:59.265Z","repository":{"id":182940187,"uuid":"656295468","full_name":"ToX82/flatpickr-fastselect","owner":"ToX82","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-21T08:57:52.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-02-15T07:20:55.320Z","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/ToX82.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}},"created_at":"2023-06-20T16:48:49.000Z","updated_at":"2024-02-15T07:20:55.321Z","dependencies_parsed_at":"2023-07-22T07:30:53.394Z","dependency_job_id":null,"html_url":"https://github.com/ToX82/flatpickr-fastselect","commit_stats":null,"previous_names":["tox82/flatpickr-fastselect"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToX82%2Fflatpickr-fastselect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToX82%2Fflatpickr-fastselect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToX82%2Fflatpickr-fastselect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToX82%2Fflatpickr-fastselect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ToX82","download_url":"https://codeload.github.com/ToX82/flatpickr-fastselect/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246239639,"owners_count":20745743,"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-12-10T09:12:40.330Z","updated_at":"2025-03-29T20:25:59.246Z","avatar_url":"https://github.com/ToX82.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flatpickr Fast Select Plugin\n\nThe Flatpickr Fast Select plugin extends the functionality of Flatpickr by allowing quick selection of a single date using predefined shortcuts.\n\n![Screenshot of Flatpickr Fast Select plugin](https://github.com/ToX82/flatpickr-fastselect/assets/659492/c67bd58c-ba78-45d3-9407-a371337ab3b7)\n\n\n## Installation\n\nTo use the Fast Select plugin, you need to include both Flatpickr and the plugin file in your project. You can install them using npm, jsdelivr or include the files manually in your project.\n\n### NPM\nYou can install the Fast Select plugin through NPM\n\n```bash\nnpm install flatpickr\nnpm install flatpickr-fast-select-plugin\n```\n\n### jsDelivr\nYou can nclude flatpickr and flatpickr-fastselect files from jsdelivr.\n\n```\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/flatpickr@4/dist/flatpickr.min.css\"\u003e\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/flatpickr-fast-select@1/flatpickr-fastselect.min.css\"\u003e\n\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/flatpickr@4/dist/flatpickr.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/flatpickr-fast-select@1/flatpickr-fastselect.min.js\"\u003e\u003c/script\u003e\n```\n\n### Manual Installation\nOr you can download the flatpickr.js and flatpickr-fast-select-plugin.js files from this repository and include them in your project.\n\n```\n\u003clink rel=\"stylesheet\" href=\"path/to/flatpickr.css\"\u003e\n\u003clink rel=\"stylesheet\" href=\"path/to/flatpickr-fastselect.css\"\u003e\n\n\u003cscript src=\"path/to/flatpickr.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"path/to/flatpickr-fastselect.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\nOnce the plugin is installed, you can use it by configuring Flatpickr with the plugin options.\n\n```\nvar fp = flatpickr(\"#myDatePicker\", {\n  // other Flatpickr options\n  plugins: [fastselectPlugin()],\n});\n```\nThe predefined shortcuts allow quick selection of common dates like \"Today\", \"Tomorrow\", \"Next week\", \"Next month\" and \"Next year\". When a shortcut is clicked, the corresponding date will be selected.\nYou can also customize the shortcuts and their actions by passing a configuration object to the plugin.\n\n```\nvar fp = flatpickr(\"#myDatePicker\", {\n  // other Flatpickr options\n  plugins: [new fastselectPlugin({\n    shortcut: [\n      { text: 'Last year', value: [ new Date(new Date().getTime() - 365 * 24 * 60 * 60 * 1000) ] },\n      { text: 'Last month', value: [ new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000) ] },\n      { text: 'Last week', value: [ new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000) ] },\n      { text: 'Yesterday', value: [ new Date(new Date().getTime() - 24 * 60 * 60 * 1000) ] },\n      { text: 'Today', value: [ new Date(new Date()) ] },\n      { text: 'Tomorrow', value: [ new Date(new Date().getTime() + 24 * 60 * 60 * 1000) ] },\n      // ... \n    ],\n  })],\n});\n```\n\n## Plugin Options\nThe Fast Select plugin only accepts the shortcut array, with the values mentioned above. You can customize those values according to your needs though.\n\n## License\nThis plugin is distributed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftox82%2Fflatpickr-fastselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftox82%2Fflatpickr-fastselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftox82%2Fflatpickr-fastselect/lists"}