Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a783dbd93f |
26
README.md
26
README.md
@@ -10,35 +10,13 @@ lunar是一款无第三方依赖的公历(阳历)和农历(阴历、老黄历)
|
|||||||
|
|
||||||
[English](https://github.com/6tail/lunar-java/blob/master/README_EN.md)
|
[English](https://github.com/6tail/lunar-java/blob/master/README_EN.md)
|
||||||
|
|
||||||
### 正式版本
|
### Maven
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.6tail</groupId>
|
<groupId>cn.6tail</groupId>
|
||||||
<artifactId>lunar</artifactId>
|
<artifactId>lunar</artifactId>
|
||||||
<version>1.2.6</version>
|
<version>1.2.7</version>
|
||||||
</dependency>
|
|
||||||
```
|
|
||||||
|
|
||||||
### 快照版本
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<repository>
|
|
||||||
<id>sonatype</id>
|
|
||||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
<updatePolicy>daily</updatePolicy>
|
|
||||||
<checksumPolicy>warn</checksumPolicy>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
|
||||||
```
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.6tail</groupId>
|
|
||||||
<artifactId>lunar</artifactId>
|
|
||||||
<version>1.2.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
26
README_EN.md
26
README_EN.md
@@ -6,35 +6,13 @@ lunar is a calendar library for Solar and Chinese Lunar.
|
|||||||
|
|
||||||
[简体中文](https://github.com/6tail/lunar-java/blob/master/README.md)
|
[简体中文](https://github.com/6tail/lunar-java/blob/master/README.md)
|
||||||
|
|
||||||
### Release
|
### Maven
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.6tail</groupId>
|
<groupId>cn.6tail</groupId>
|
||||||
<artifactId>lunar</artifactId>
|
<artifactId>lunar</artifactId>
|
||||||
<version>1.2.6</version>
|
<version>1.2.7</version>
|
||||||
</dependency>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Snapshot
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<repository>
|
|
||||||
<id>sonatype</id>
|
|
||||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
<updatePolicy>daily</updatePolicy>
|
|
||||||
<checksumPolicy>warn</checksumPolicy>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
|
||||||
```
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.6tail</groupId>
|
|
||||||
<artifactId>lunar</artifactId>
|
|
||||||
<version>1.2.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -7,7 +7,7 @@
|
|||||||
<groupId>cn.6tail</groupId>
|
<groupId>cn.6tail</groupId>
|
||||||
<artifactId>lunar</artifactId>
|
<artifactId>lunar</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.2.6</version>
|
<version>1.2.7</version>
|
||||||
<name>${project.groupId}:${project.artifactId}</name>
|
<name>${project.groupId}:${project.artifactId}</name>
|
||||||
<url>https://github.com/6tail/lunar-java</url>
|
<url>https://github.com/6tail/lunar-java</url>
|
||||||
<description>a calendar library for Solar and Chinese Lunar</description>
|
<description>a calendar library for Solar and Chinese Lunar</description>
|
||||||
|
|||||||
@@ -156,6 +156,14 @@ public class Solar {
|
|||||||
f -= minute;
|
f -= minute;
|
||||||
f *= 60;
|
f *= 60;
|
||||||
int second = (int) Math.round(f);
|
int second = (int) Math.round(f);
|
||||||
|
if (second > 59) {
|
||||||
|
second -= 60;
|
||||||
|
minute++;
|
||||||
|
}
|
||||||
|
if (minute > 59) {
|
||||||
|
minute -= 60;
|
||||||
|
hour++;
|
||||||
|
}
|
||||||
|
|
||||||
calendar = ExactDate.fromYmdHms(year, month, day, hour, minute, second);
|
calendar = ExactDate.fromYmdHms(year, month, day, hour, minute, second);
|
||||||
this.year = year;
|
this.year = year;
|
||||||
|
|||||||
@@ -173,4 +173,17 @@ public class JieQiTest {
|
|||||||
Assert.assertEquals("冬至", lunar.getPrevQi().getName());
|
Assert.assertEquals("冬至", lunar.getPrevQi().getName());
|
||||||
Assert.assertEquals("冬至", lunar.getPrevJieQi().getName());
|
Assert.assertEquals("冬至", lunar.getPrevJieQi().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test7() {
|
||||||
|
Lunar lunar = Lunar.fromYmd(2012, 9, 1);
|
||||||
|
Assert.assertEquals("2012-09-07 13:29:00", lunar.getJieQiTable().get("白露").toYmdHms());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test8() {
|
||||||
|
Lunar lunar = Lunar.fromYmd(2050, 12, 1);
|
||||||
|
Assert.assertEquals("2050-12-07 06:41:00", lunar.getJieQiTable().get("大雪").toYmdHms());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user