sard 1.0.25 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sard",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "sard 是基于 Vue3 的 Web 移动端 UI 组件库",
5
5
  "keywords": [
6
6
  "UI",
package/utils/date.d.ts CHANGED
@@ -49,7 +49,7 @@ export declare function getNextMonthHeadDays(year: number, month: number, weekSt
49
49
  /**
50
50
  * 根据传入的占位符返回格式化后的日期。
51
51
  */
52
- export declare function formatDate(date: Date, format?: string): string;
52
+ export declare function formatDate(date: Date | number | string, format?: string): string;
53
53
  /**
54
54
  * 解析日期的字符串表示形式,并返回 Date 实例对象。
55
55
  */
package/utils/date.js CHANGED
@@ -122,6 +122,7 @@ const dateGetters = {
122
122
  * 根据传入的占位符返回格式化后的日期。
123
123
  */
124
124
  function formatDate(date, format = "YYYY-MM-DD HH:mm:ss") {
125
+ date = toDate(date);
125
126
  return format.replace(dateTokensReg, (match) => {
126
127
  return dateGetters[match](date);
127
128
  });