From cb2a01ee7dea28a2661720060b03c41dc372acb5 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期五, 01 八月 2025 11:53:16 +0800
Subject: [PATCH] 完善串口处理数据,数据选择
---
src/utils/date.js | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/src/utils/date.js b/src/utils/date.js
index 3f4a780..6d2c1a5 100644
--- a/src/utils/date.js
+++ b/src/utils/date.js
@@ -51,4 +51,31 @@
return format
}
return ''
+}
+
+/**
+ * 鑾峰彇骞存湀鏃� 26鍙�+1
+ * @param date
+ * @returns {string}
+ */
+export function getYearAndMonthAndDaysZTZB(date = new Date()) {
+ let year = date.getFullYear();
+ let month = date.getMonth();
+ let days = date.getDate();
+
+ // 鍒ゆ柇鏄惁鏄�26鍙�
+ if (days === 26) {
+ month++;
+ if (month > 11) {
+ month = 0;
+ year++;
+ }
+ }
+
+ month += 1;
+ month = month < 10 ? '0' + month + '-' : month + '-';
+ year = year + '-';
+ days = days < 10 ? '0' + days : days;
+
+ return (year + month + days);
}
\ No newline at end of file
--
Gitblit v1.9.3