{"id":17650679,"url":"https://github.com/sebhoss/fiscal-year","last_synced_at":"2025-09-02T23:33:59.018Z","repository":{"id":57722650,"uuid":"12201176","full_name":"sebhoss/fiscal-year","owner":"sebhoss","description":"Java library to work with fiscal years.","archived":false,"fork":false,"pushed_at":"2017-02-15T21:28:36.000Z","size":237,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T07:07:10.861Z","etag":null,"topics":["date","economics","fiscal","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebhoss.png","metadata":{"files":{"readme":"README.asciidoc","changelog":"CHANGELOG.asciidoc","contributing":"CONTRIBUTING.asciidoc","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.asciidoc","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-18T20:17:11.000Z","updated_at":"2024-02-23T19:56:43.000Z","dependencies_parsed_at":"2022-08-28T08:40:41.563Z","dependency_job_id":null,"html_url":"https://github.com/sebhoss/fiscal-year","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebhoss%2Ffiscal-year","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebhoss%2Ffiscal-year/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebhoss%2Ffiscal-year/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebhoss%2Ffiscal-year/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebhoss","download_url":"https://codeload.github.com/sebhoss/fiscal-year/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252831256,"owners_count":21810783,"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":["date","economics","fiscal","java"],"created_at":"2024-10-23T11:39:14.773Z","updated_at":"2025-05-07T07:07:30.661Z","avatar_url":"https://github.com/sebhoss.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Fiscal-Year image:https://img.shields.io/badge/email-%40metio-brightgreen.svg?style=social\u0026label=mail[\"Discuss on Google Groups\", link=\"https://groups.google.com/forum/#!forum/metio\"] image:https://img.shields.io/badge/irc-%23metio.wtf-brightgreen.svg?style=social\u0026label=IRC[\"Chat on IRC\", link=\"http://webchat.freenode.net/?channels=metio.wtf\"]\nSebastian Hoß \u003chttps://github.com/sebhoss[@sebhoss]\u003e\n:github-org: sebhoss\n:project-name: fiscal-year\n:project-group: de.xn--ho-hia.utils.fiscal_year\n:coverity-project: 9338\n:codacy-project: cd259740862044fa9d06e7788b7d577f\n:toc:\n:toc-placement: preamble\n\nimage:https://img.shields.io/badge/license-cc%20zero-000000.svg?style=flat-square[\"CC Zero\", link=\"http://creativecommons.org/publicdomain/zero/1.0/\"]\npass:[\u003cspan class=\"image\"\u003e\u003ca class=\"image\" href=\"https://maven-badges.herokuapp.com/maven-central/de.xn--ho-hia.utils.fiscal_year/fiscal-year\"\u003e\u003cimg src=\"https://img.shields.io/maven-central/v/de.xn--ho-hia.utils.fiscal_year/fiscal-year.svg?style=flat-square\" alt=\"Maven Central\"\u003e\u003c/a\u003e\u003c/span\u003e]\npass:[\u003cspan class=\"image\"\u003e\u003ca class=\"image\" href=\"https://www.javadoc.io/doc/de.xn--ho-hia.utils.fiscal_year/fiscal-year\"\u003e\u003cimg src=\"https://www.javadoc.io/badge/de.xn--ho-hia.utils.fiscal_year/fiscal-year.svg?style=flat-square\u0026color=blue\" alt=\"Read JavaDocs\"\u003e\u003c/a\u003e\u003c/span\u003e]\nimage:https://reposs.herokuapp.com/?path={github-org}/{project-name}\u0026style=flat-square[\"Repository size\"]\nimage:https://www.openhub.net/p/{project-name}/widgets/project_thin_badge.gif[\"Open Hub statistics\", link=\"https://www.openhub.net/p/{project-name}\"]\n\nimage:https://img.shields.io/jenkins/s/https/build.metio.wtf/job/{github-org}/job/{project-name}/job/{project-name}_verify.svg?style=flat-square[\"Build Status\", link=\"https://build.metio.wtf/job/{github-org}/job/{project-name}/\"]\npass:[\u003cspan class=\"image\"\u003e\u003ca class=\"image\" href=\"https://quality.metio.wtf/dashboard?id=de.xn--ho-hia.utils.fiscal_year%3Afiscal-year\"\u003e\u003cimg src=\"https://img.shields.io/sonar/https/quality.metio.wtf/de.xn--ho-hia.utils.fiscal_year:fiscal-year/coverage.svg?style=flat-square\" alt=\"Code Coverage\"\u003e\u003c/a\u003e\u003c/span\u003e]\npass:[\u003cspan class=\"image\"\u003e\u003ca class=\"image\" href=\"https://quality.metio.wtf/dashboard?id=de.xn--ho-hia.utils.fiscal_year%3Afiscal-year\"\u003e\u003cimg src=\"https://img.shields.io/sonar/https/quality.metio.wtf/de.xn--ho-hia.utils.fiscal_year:fiscal-year/tech_debt.svg?style=flat-square\" alt=\"Technical Debt\"\u003e\u003c/a\u003e\u003c/span\u003e]\nimage:https://img.shields.io/coverity/scan/{coverity-project}.svg?style=flat-square[\"Coverity Scan Result\", link=\"https://scan.coverity.com/projects/{github-org}-{project-name}\"]\nimage:https://img.shields.io/codacy/grade/{codacy-project}.svg?style=flat-square[\"Codacy Code Quality\", link=\"https://www.codacy.com/app/mail_7/{project-name}\"]\nimage:https://img.shields.io/badge/forkable-yes-brightgreen.svg?style=flat-square[\"Can this project be forked?\", link=\"https://basicallydan.github.io/forkability/?u={github-org}\u0026r={project-name}\"]\nimage:https://img.shields.io/maintenance/yes/2017.svg?style=flat-square[\"Is this thing still maintained?\"]\nimage:https://img.shields.io/bountysource/team/metio/activity.svg?style=flat-square[\"Bounties on open tickets\", link=\"https://www.bountysource.com/teams/metio\"]\n\nYour company doesn't work from January 1 to December 31? Try fiscal-year, a small Java library which converts calendar-year based dates to corresponding dates in a link:http://en.wikipedia.org/wiki/Fiscal_year[fiscal year].\n\n== Features\n\n* Immutable data structure\n* Convert from/to Java 8 `LocalDate`\n* Math operations like `plusDays`, `minusWeeks`\n* Factories to create/configure\n\n== Development Status\n\nAll currently required feature are implemented. This project is in maintenance mode.\n\n== Usage\n\nFirst create a `FiscalYearFactory` which holds the configuration of your company's fiscal year:\n\n[source, java]\n----\n// fiscal year starts at month 11 of the 'previous' year\nFiscalYearFactory earlyYearFactory = FiscalYears.earlyFiscalYear(11);\n\n// fiscal year starts at month 3 in the 'current' year\nFiscalYearFactory lateYearFactory = FiscalYears.lateFiscalYear(3);\n----\n\nThen use this factory to convert a calendar-year based `LocalDate` to a corresponding `FiscalDate`:\n\n[source, java]\n----\nLocalDate calendarDate = LocalDate.now();\nFiscalDate fiscalDate = factory.createFromCalendarDate(calendarDate);\n----\n\nUse fiscal-year based values directly to create an instance of `FiscalDate`:\n\n[source, java]\n----\nFiscalDate fiscalDate = factory.create(2015, 3, 25);\n----\n\nQuery the newly created `FiscalDate` to retrieve the usual suspects of attributes:\n\n[source, java]\n----\nint fiscalYear = fiscalDate.getFiscalYear();\nint fiscalMonth = fiscalDate.getFiscalMonth();\nint fiscalDayOfYear = fiscalDate.getFiscalDayOfYear();\nint fiscalWeekOfWeekyear = fiscalDate.getFiscalWeekOfWeekyear();\n\nint calendarYear = fiscalDate.getCalendarYear();\nint calendarMonth = fiscalDate.getCalendarMonth();\nint calendarDayOfMonth = fiscalDate.getCalendarDayOfMonth();\nint calendarDayOfYear = fiscalDate.getCalendarDayOfYear();\nint calendarWeekOfWeekyear = fiscalDate.getCalendarWeekOfWeekyear();\n----\n\nDo some math with dates as follows:\n\n[source, java]\n----\nFiscalDate newDate = fiscalDate.plusYears(int years);\nFiscalDate newDate = fiscalDate.plusMonths(int months);\nFiscalDate newDate = fiscalDate.plusWeeks(int weeks);\nFiscalDate newDate = fiscalDate.plusDays(int days);\nFiscalDate newDate = fiscalDate.minusYears(int years);\nFiscalDate newDate = fiscalDate.minusMonths(int months);\nFiscalDate newDate = fiscalDate.minusWeeks(int weeks);\nFiscalDate newDate = fiscalDate.minusDays(int days);\n----\n\nOr finally convert it back to a `LocalDate`:\n\n[source, java]\n----\nLocalDate calendarDate = fiscalDate.asLocalDate();\n----\n\n=== Integration\n\nTo use this project just declare the following dependency inside your POM:\n\n[source, xml, subs=\"attributes,verbatim\"]\n----\n\u003cdependency\u003e\n  \u003cgroupId\u003e{project-group}\u003c/groupId\u003e\n  \u003cartifactId\u003e{project-name}\u003c/artifactId\u003e\n  \u003cversion\u003e${version.fiscal-year}\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\nReplace `${version.fiscal-year}` with the link:++http://search.maven.org/#search%7Cga%7C1%7Cg%3Ade.xn--ho-hia.utils.fiscal_year%20a%3Afiscal-year++[latest release]. This project follows the link:http://semver.org/[semantic versioning guidelines].\n\n=== Compatibility\n\nThis project is compatible with the following Java versions:\n\n.Java compatibility\n|===\n| | 1.X.Y | 2.X.Y | 3.X.Y\n\n| Java 8\n| ✓\n| ✓\n| ✓\n|===\n\n== License\n\nTo the extent possible under law, the author(s) have dedicated all copyright\nand related and neighboring rights to this software to the public domain\nworldwide. This software is distributed without any warranty.\n\nYou should have received a copy of the CC0 Public Domain Dedication along\nwith this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.\n\n== Mirrors\n\n* https://github.com/sebhoss/{project-name}\n* https://bitbucket.org/sebhoss/{project-name}\n* https://gitlab.com/sebastian.hoss/{project-name}\n* http://v2.pikacode.com/sebhoss/{project-name}\n* http://repo.or.cz/fiscal-year.java.git\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebhoss%2Ffiscal-year","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebhoss%2Ffiscal-year","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebhoss%2Ffiscal-year/lists"}