https://github.com/miyako/calendarjp
Support Japanese Calendar
https://github.com/miyako/calendarjp
4d-class 4d-component
Last synced: 3 months ago
JSON representation
Support Japanese Calendar
- Host: GitHub
- URL: https://github.com/miyako/calendarjp
- Owner: miyako
- License: mit
- Created: 2024-08-20T10:04:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-10-31T14:55:41.000Z (8 months ago)
- Last Synced: 2025-10-31T16:22:43.132Z (8 months ago)
- Topics: 4d-class, 4d-component
- Language: 4D
- Homepage: https://miyako.github.io/CalendarJp/
- Size: 1.24 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](LICENSE)

switch to [`20.x`](https://github.com/miyako/calendarJp/tree/20.x) branch for 4D 20 LTS compatible version.
# CalendarJp
Support Japanese Calendar
### Compatibility

* [string format](https://blog.4d.com/tailored-customization-for-dates-and-times/)

* [shared singleton](https://blog.4d.com/singletons-in-4d/)

* [declare and assign](https://blog.4d.com/simplify-variable-declarations-assignments-in-a-single-line/)
## dependencies.json
```json
{
"dependencies": {
"CalendarJp": {
"github": "miyako/CalendarJp",
"version": "latest"
}
}
}
```
## Usage
```4d
var $CalendarJp : cs.CalendarJp.CalendarJp
$CalendarJp:=cs.CalendarJp.CalendarJp.me
//meiji test
$test:=$CalendarJp.convertFromGregorian(!1868-01-25!) //1.1.1
$test:=$CalendarJp.convertFromGregorian(!1868-02-23!) //1.2.1
$test:=$CalendarJp.convertFromGregorian(!1868-03-24!) //1.3.1
$test:=$CalendarJp.convertFromGregorian(!1868-10-23!) //1.9.8
$test:=$CalendarJp.convertFromGregorian(!1868-06-11!) //1.4.21
$test:=$CalendarJp.String(!1868-06-11!; "ggggy年M月d日") //明治元年潤4月21日
$test:=$CalendarJp.String(!1989-01-07!; "g.y年M月d日") //S.64年1月7日
$test:=$CalendarJp.String(!1989-01-08!; "ggy年M月d日") //平元年1月8日
$test:=$CalendarJp.String(!2019-04-30!; "gggy年M月d日") //㍻31年4月30日
$test:=$CalendarJp.String(!2019-05-01!; "ggggy年M月d日") //令和元年5月1日
```