From e234a15b428267997c903a4ed42536c5d9f14a1f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 10 十一月 2025 13:10:42 +0800
Subject: [PATCH] 2025.11.10 1. 新增巡查场景历史详情相关数据逻辑; 2. 新增工地施工阶段修改界面;

---
 app/src/main/java/cn/flightfeather/thirdappmodule/util/DateUtil.kt |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/app/src/main/java/cn/flightfeather/thirdappmodule/util/DateUtil.kt b/app/src/main/java/cn/flightfeather/thirdappmodule/util/DateUtil.kt
index 47028f3..359b613 100644
--- a/app/src/main/java/cn/flightfeather/thirdappmodule/util/DateUtil.kt
+++ b/app/src/main/java/cn/flightfeather/thirdappmodule/util/DateUtil.kt
@@ -82,6 +82,18 @@
     }
 
     /**
+     * MM
+     */
+    fun getMonthStr(date: Date?): String {
+        try {
+            return getDateStr(date).substring(5, 7)
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return ""
+    }
+
+    /**
      * dd
      */
     fun getDayStr(date: Date?): String {
@@ -151,13 +163,13 @@
         return weekDays[index]
     }
 
-    fun parseYearMonth(str: String): Date {
-        try {
-            return SimpleDateFormat("yyyy-MM", Locale.getDefault()).parse(str)
+    fun parseYearMonth(str: String?): Date? {
+        return try {
+            SimpleDateFormat("yyyy-MM", Locale.getDefault()).parse(str)
         } catch (e: Exception) {
             e.printStackTrace()
+            null
         }
-        return Date()
     }
 
     fun parseYearToMin(str: String): Date {

--
Gitblit v1.9.3