{"id":18339151,"url":"https://github.com/dotnet-websharper/datefns","last_synced_at":"2025-04-09T20:36:44.777Z","repository":{"id":48039272,"uuid":"390302398","full_name":"dotnet-websharper/datefns","owner":"dotnet-websharper","description":"DateFns bindings for WebSharper.","archived":false,"fork":false,"pushed_at":"2025-03-22T20:53:20.000Z","size":343,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-22T21:34:22.038Z","etag":null,"topics":["datefns","fsharp","websharper"],"latest_commit_sha":null,"homepage":"","language":"F#","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/dotnet-websharper.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-28T10:01:35.000Z","updated_at":"2025-03-22T20:53:12.000Z","dependencies_parsed_at":"2023-09-27T14:50:02.072Z","dependency_job_id":"8dff69e4-e168-4ff9-95f5-638662281b48","html_url":"https://github.com/dotnet-websharper/datefns","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-websharper%2Fdatefns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-websharper%2Fdatefns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-websharper%2Fdatefns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-websharper%2Fdatefns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotnet-websharper","download_url":"https://codeload.github.com/dotnet-websharper/datefns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248108671,"owners_count":21049173,"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":["datefns","fsharp","websharper"],"created_at":"2024-11-05T20:16:39.375Z","updated_at":"2025-04-09T20:36:44.753Z","avatar_url":"https://github.com/dotnet-websharper.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebSharper.DateFNS\n\nProvides `date-fns` bindings for [WebSharper](https://websharper.com/).\n\n## date-fns sources\n\n* Check [API documentation](https://date-fns.org/docs/Getting-Started)\n* Check [date-fns GH](https://github.com/date-fns/date-fns)\n\n## Examples\n\nFrom the F# side, use `DateFNS` object:\n\n```fsharp\nlet date = DateFNS.Format(Date(2014, 1, 11), \"MM/dd/yyyy\") // \"02/11/2014\"\n```\n\nYou can use locales for example like this:\n\n```fsharp\nlet formatOpt = FormatOptions()\nformatOpt.Locale \u003c- Locales.JA\nlet localeDate = DateFNS.Format(Date(2021, 7, 10), \"MMM dd yyyy\", formatOpt) // \"8月 10 2021\"\nlet defaultDate = DateFNS.Format(Date(2021, 7, 10), \"MMM dd yyyy\") // \"Aug 10 2021\"\n```\n\nHelper methods for different date kinds:\n\n```fsharp\nlet b = DateFNS.IsLastDayOfMonth(Date(2021, 6, 31)) // true\n\nlet isT = DateFNS.IsTuesday(Date(2021, 7, 10)) // true\n\nlet diff = DateFNS.DifferenceInMinutes(\n    Date(2014, 6, 2, 12, 20, 0),\n    Date(2014, 6, 2, 12, 7, 59)) // 12\n```\n\n## Contributing\n\nThe case with date-fns is that we'd like to have a bundled JS version of it but since there we haven't found a CDN that like that we have to make it ourselves.\n\nThe following steps should help you make a bundled js version of both the main date-fns and its locales. If you find a better way to achieve all this, please update the README with a guide!\n\n* clone the [date-fns repository](https://github.com/date-fns/date-fns)\n* compile the project\n* supposing the output is in the dist folder, use [rollup](https://rollupjs.org/guide/en/) to make a bundle. Now it might not be able to resolve everything when using `rollup dist/src/index.js --format iife --file output.js --name datefns`. You might need to use the `nodeResolve` plugin for it to work. Make a rollup config file for that. Example:\n\n  ```js\n  import { nodeResolve } from '@rollup/plugin-node-resolve';\n\n  export default {\n      input: 'dist/src/index.js',\n      output: {\n          file: 'output.js',\n          format: 'iife',\n          name: 'datefns'\n      },\n      plugins: [nodeResolve()]\n  };\n  ```\n  \n\n  With this do `rollup --config rollup.config.js`\n* Use rollup on the locale files and put them into the `locales` folder\n* Make sure to minify all js files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet-websharper%2Fdatefns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotnet-websharper%2Fdatefns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet-websharper%2Fdatefns/lists"}