{"id":15681271,"url":"https://github.com/n1k0/elm-daterange-picker","last_synced_at":"2025-12-11T20:55:53.601Z","repository":{"id":38818032,"uuid":"196403816","full_name":"n1k0/elm-daterange-picker","owner":"n1k0","description":"A date range picker written in Elm.","archived":false,"fork":false,"pushed_at":"2023-01-08T17:20:46.000Z","size":347,"stargazers_count":12,"open_issues_count":6,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-07T04:12:07.350Z","etag":null,"topics":["component","datepicker","elm","html","time"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/n1k0/elm-daterange-picker/latest/","language":"Elm","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/n1k0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-11T13:49:16.000Z","updated_at":"2024-08-24T22:54:04.000Z","dependencies_parsed_at":"2023-02-08T06:45:16.855Z","dependency_job_id":null,"html_url":"https://github.com/n1k0/elm-daterange-picker","commit_stats":null,"previous_names":["allo-media/elm-daterange-picker"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n1k0%2Felm-daterange-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n1k0%2Felm-daterange-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n1k0%2Felm-daterange-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n1k0%2Felm-daterange-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n1k0","download_url":"https://codeload.github.com/n1k0/elm-daterange-picker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810274,"owners_count":21807759,"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":["component","datepicker","elm","html","time"],"created_at":"2024-10-03T16:51:51.336Z","updated_at":"2025-12-11T20:55:48.558Z","avatar_url":"https://github.com/n1k0.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elm-daterange-picker\n\nA date range picker written in [Elm](https://elm-lang.org/) ([Demo](https://n1k0.github.io/elm-daterange-picker/)).\n\n\u003e Note: this package, previously known as `allo-media/elm-daterange-picker`, has moved to `n1k0/elm-daterange-picker`. New versions will be released from there, but starting from `1.0.0`.\n\n## How is this useful?\n\n![](https://i.imgur.com/NL66R88.png)\n\nSelecting a date range is a common operation for many Web applications. While there are offerings in the Elm ecosystem, we couldn't find any ergonomic equivalent of [daterangepicker](http://www.daterangepicker.com/), which this package takes a lot of inspiration from.\n\n## Demo\n\nYou can look at how this package can be used by browsing this demo code [here](https://github.com/n1k0/elm-daterange-picker/blob/master/demo/Main.elm).\n\n## Usage\n\n```elm\nimport Browser\nimport DateRangePicker as Picker\nimport Html exposing (Html, text)\n\ntype alias Model =\n    { picker : Picker.State }\n\ntype Msg\n    = PickerChanged Picker.State\n\ninit : () -\u003e ( Model, Cmd Msg )\ninit _ =\n    let\n        picker =\n            Picker.init Picker.defaultConfig Nothing\n    in\n    ( { picker = picker }\n    , Picker.now PickerChanged picker\n    )\n\nupdate : Msg -\u003e Model -\u003e ( Model, Cmd Msg )\nupdate msg model =\n    case msg of\n        PickerChanged state -\u003e\n            ( { model | picker = state }, Cmd.none )\n\nview : Model -\u003e Html Msg\nview model =\n    Picker.view PickerChanged model.picker\n\nmain =\n    Browser.element\n        { init = init\n        , update = update\n        , view = view\n        , subscriptions = .picker \u003e\u003e Picker.subscriptions PickerChanged\n        }\n```\n\n## Customize styles\n\nBy default, we have not defined any default `font-family`, so that the style fits any app/site.\n\nYou can use the [style.css] file or its [SCSS source] as a starting point for fine-tuning the default styles of the datepicker, which also uses CSS variables to help you tweaking most colors used by the component; just add your own root colors **after** calling our CSS, and it's done:\n\n```CSS\n:root {\n  --edrp-background-color: #fff;\n  --edrp-font-color: rgba(0, 0, 0, 0.8);\n  --edrp-primary-color: rgb(82, 143, 255);\n  --edrp-primary-color-alpha: rgba(82, 143, 255, 0.25);\n  --edrp-border-color: lightgrey;\n}\n```\n\nSo if you have questionable tastes, you can eventually obtain this:\n\n![](https://i.imgur.com/sbDCvi6.png)\n\n## Install\n\n    elm install n1k0/elm-daterange-picker\n\n## Local install\n\n    npm install\n\n## Run the demo\n\nThe demo is powered by [parcel](https://parceljs.org/), meaning any code changes will trigger a page reload. Neat!\n\n    npm start\n\nThen head to [localhost:1234](http://localhost:1234/) from your browser.\n\n## Credits\n\n- [BeardedBear](https://github.com/BeardedBear) for the default styles.\n- [Allo-Media](https://www.allo-media.net/) for initially backing up the package development.\n\n## License\n\nMIT\n\n[style.css]: https://github.com/n1k0/elm-daterange-picker/blob/master/demo/style.css\n[scss source]: https://github.com/n1k0/elm-daterange-picker/blob/master/demo/style.scss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn1k0%2Felm-daterange-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn1k0%2Felm-daterange-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn1k0%2Felm-daterange-picker/lists"}