浏览代码

修复计算区间错误问题

wangzhun 1 年之前
父节点
当前提交
503c6157c7
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      common-core/pom.xml
  2. 1 1
      common-core/src/main/java/com/tofly/common/core/util/Date8Util.java

+ 1 - 1
common-core/pom.xml

@@ -11,7 +11,7 @@
 
     <artifactId>common-core</artifactId>
     <packaging>jar</packaging>
-    <version>1.0.0</version>
+    <version>1.0.1</version>
 
     <properties>
         <poi.version>3.17</poi.version>

+ 1 - 1
common-core/src/main/java/com/tofly/common/core/util/Date8Util.java

@@ -280,7 +280,7 @@ public class Date8Util {
         LocalDate localDate2=LocalDate.of(Integer.parseInt(date2.substring(0,4)),
                 Integer.parseInt(date2.substring(4)),1);
 
-        return Period.between(localDate1,localDate2).getMonths();
+        return Period.between(localDate1,localDate2).getYears()*12+ Period.between(localDate1,localDate2).getMonths();
     }
 
     public static int between(String date){