https://github.com/bannzai/eracalculator
Last library of 平成.
https://github.com/bannzai/eracalculator
Last synced: about 1 year ago
JSON representation
Last library of 平成.
- Host: GitHub
- URL: https://github.com/bannzai/eracalculator
- Owner: bannzai
- License: mit
- Created: 2019-04-30T13:31:38.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T15:32:53.000Z (about 7 years ago)
- Last Synced: 2025-04-06T05:00:00.969Z (about 1 year ago)
- Language: Swift
- Size: 29.3 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EraCalculator
Last library of 平成.
So, in Japan change era. This library is my memorial library.
## Usage
EraCalculator can convert other Era years.
This example is Calculates what year of 大化 was when the 平成 was 大化.
```swift
let expected = Era(eraType: .大化, year: 1345)
let got = EraType.平成.convert(to: EraType.大化)
XCTAssertEqual(got.eraType, expected.eraType)
XCTAssertEqual(got.year, expected.year)
XCTAssertEqual(got.description, "大化 1345年")
```
## LICENSE
EraCalculator is available under the MIT license.
See the LICENSE file for more info.