5

几个月以下要关联的任何枚举?

1 Muharram
2 Safar
3 Rabi\u02bb I
  Rabi\u02bb II
  Jumada I
  Jumada II
  Rajab
  Sha\u02bbban
  Ramadan
  Shawwal
  Dhu\u02bbl-Qi\u02bbdah
  Dhu\u02bbl-Hijjah
4

1 回答 1

2

看看Time4j库,日历项目。

Maven依赖:

<dependency>
    <groupId>net.time4j</groupId>
    <artifactId>time4j-calendar</artifactId>
    <version>4.24</version>
</dependency>

例子:

Stream.of(HijriMonth.values()).forEach(v->
            System.out.println("Display name: " + v.getDisplayName(Locale.US) + " month index: " + v.getValue()));

输出:

Display name: Muharram month index: 1
Display name: Safar month index: 2
Display name: Rabiʻ I month index: 3
Display name: Rabiʻ II month index: 4
Display name: Jumada I month index: 5
Display name: Jumada II month index: 6
Display name: Rajab month index: 7
Display name: Shaʻban month index: 8
Display name: Ramadan month index: 9
Display name: Shawwal month index: 10
Display name: Dhuʻl-Qiʻdah month index: 11
Display name: Dhuʻl-Hijjah month index: 12
于 2017-02-19T15:50:13.163 回答