Commit a04d76ce65a77fce8728ea22cff5559c91b43f5e
1 parent
17c1b822c0
Exists in
master
and in
6 other branches
update code
Showing 1 changed file with 13 additions and 7 deletions
platform-msg-generate/src/main/java/com/lyms/platform/msg/utils/HelperUtils.java
View file @
a04d76c
| ... | ... | @@ -235,17 +235,23 @@ |
| 235 | 235 | |
| 236 | 236 | /** |
| 237 | 237 | * 返回孕周天数 |
| 238 | - * @param lastMenses | |
| 238 | + * @param start | |
| 239 | 239 | * @return |
| 240 | 240 | */ |
| 241 | - public static String getYunWeekDay(Date lastMenses) { | |
| 242 | - if (lastMenses == null) | |
| 241 | + public static String getYunWeekDay(Date start) { | |
| 242 | + if(start == null) { | |
| 243 | + return "孕0周+0天"; | |
| 244 | + } | |
| 245 | + String weekStr = ""; | |
| 246 | + Integer betweenDay = DateUtils.daysBetween(start, new Date()); | |
| 247 | + Integer week = betweenDay / 7; | |
| 248 | + Integer day = betweenDay % 7; | |
| 249 | + weekStr = "孕" + week + "周"; | |
| 250 | + if (day > 0) | |
| 243 | 251 | { |
| 244 | - return ""; | |
| 252 | + weekStr += day + "天"; | |
| 245 | 253 | } |
| 246 | - int day = DateUtils.daysBetween(lastMenses,new Date()); | |
| 247 | - | |
| 248 | - return day+"天"; | |
| 254 | + return weekStr; | |
| 249 | 255 | } |
| 250 | 256 | |
| 251 | 257 |