{"id":19555044,"url":"https://github.com/kanety/fiscaly","last_synced_at":"2026-02-28T04:32:44.661Z","repository":{"id":56846555,"uuid":"160919604","full_name":"kanety/fiscaly","owner":"kanety","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-12T07:59:07.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-20T02:04:17.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/kanety.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-12-08T08:29:07.000Z","updated_at":"2026-01-12T07:51:54.000Z","dependencies_parsed_at":"2025-01-20T02:33:00.517Z","dependency_job_id":"34f29ab5-fd12-45fb-b53c-fc1c759afa5a","html_url":"https://github.com/kanety/fiscaly","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"96ccd871be164fb208c2c9ee637039b27c24d783"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kanety/fiscaly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanety%2Ffiscaly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanety%2Ffiscaly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanety%2Ffiscaly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanety%2Ffiscaly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kanety","download_url":"https://codeload.github.com/kanety/fiscaly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanety%2Ffiscaly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29924731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"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":[],"created_at":"2024-11-11T04:31:23.414Z","updated_at":"2026-02-28T04:32:44.656Z","avatar_url":"https://github.com/kanety.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fiscaly\n\nFiscal date class for ruby.\n\n## Dependencies\n\n* ruby 3.0+\n* activesupport 7.0+\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'fiscaly'\n```\n\nThen execute:\n\n    $ bundle\n\n## Usage\n\nConfigure fiscal year:\n\n```ruby\n# set the start month of the fiscal year\nFiscaly.start_month = 4\n\n# set true if the fiscal year is based on the following year\nFiscaly.forward_fyear = false\n```\n\nCreate from calendar year:\n\n```ruby\nfiscal = Fiscaly.ymd(2017, 1, 1)\nfiscal.date\n#=\u003e 2017-01-01\n\nfiscal = Fiscaly.date(Date.new(2017, 1, 1))\nfiscal.date\n#=\u003e 2017-01-01\n\nfiscal = Fiscaly.parse(\"2017-01-01\")\nfiscal.date\n#=\u003e 2017-01-01\n```\n\nIf you want to create from fiscal year, following methods are available:\n\n```ruby\nfiscal = Fiscaly.fymd(2017, 1, 1)\nfiscal.date\n#=\u003e 2018-01-01\n\nfiscal = Fiscaly.fdate(Date.new(2017, 1, 1))\nfiscal.date\n#=\u003e 2018-01-01\n\nfiscal = Fiscaly.fparse(\"2017-01-01\")\nfiscal.date\n#=\u003e 2018-01-01\n```\n\nNote that these methods converts the fiscal year to the calendar year but the month and the day are kept as it is.\n\nGet the range of financial calendar:\n\n```ruby\nfiscal = Fiscaly.ymd(2017, 1, 1)\n\nfiscal.beginning_of_fyear\n#=\u003e 2016-04-01\nfiscal.end_of_fyear\n#=\u003e 2017-03-31\nfiscal.range_of_fyear\n#=\u003e 2016-04-01..2017-03-31\n\nfiscal.beginning_of_fhalf\n#=\u003e 2016-10-01\nfiscal.end_of_fhalf\n#=\u003e 2017-03-31\nfiscal.range_of_fhalf\n#=\u003e 2016-10-01..2017-03-31\n\nfiscal.beginning_of_fhalf(0)\n#=\u003e 2016-04-01\nfiscal.end_of_fhalf(0)\n#=\u003e 2016-09-30\nfiscal.range_of_fhalf(0)\n#=\u003e 2016-04-01..2016-09-30\n\nfiscal.beginning_of_fquarter\n#=\u003e 2017-01-01\nfiscal.end_of_fquarter\n#=\u003e 2017-03-31\nfiscal.range_of_fquarter\n#=\u003e 2017-01-01..2017-03-31\n\nfiscal.beginning_of_fquarter(0)\n#=\u003e 2016-04-01\nfiscal.end_of_fquarter(0)\n#=\u003e 2016-06-30\nfiscal.range_of_fquarter(0)\n#=\u003e 2016-04-01..2016-06-30\n```\n\nChange the configurations in some context:\n\n```ruby\n# set by argument\nfiscal = Fiscaly.ymd(2017, 10, 1, start_month: 10, forward_fyear: true)\nfiscal.fyear  #=\u003e 2018\n\n# set by block\nFiscaly.with(start_month: 10, forward_fyear: true) do\n  fiscal = Fiscaly.ymd(2017, 10, 1)\n  fiscal.fyear  #=\u003e 2018\nend\n```\n\nExtend ruby's standard `Date` class:\n\n```ruby\nrequire 'fiscaly/extension'\n\ndate = Date.today.fiscaly\ndate.fyear\n```\n\n## Contributing\n\nBug reports and pull requests are welcome at https://github.com/kanety/fiscaly.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanety%2Ffiscaly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanety%2Ffiscaly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanety%2Ffiscaly/lists"}