From 0afc4b5e440e4a70be288915a067d688dcca5c2c Mon Sep 17 00:00:00 2001 From: clz Date: Tue, 6 Sep 2022 01:18:19 +0800 Subject: [PATCH] =?UTF-8?q?fix=F0=9F=9B=A0=EF=B8=8F:=20=E7=BB=9F=E4=B8=80d?= =?UTF-8?q?ate=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/model/index.ts | 4 +++- yarn.lock | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9d8124e..57e22d7 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@nextui-org/react": "^1.0.0-beta.9", "antd": "^4.22.8", "axios": "^0.27.2", - "dayjs": "^1.11.4", + "dayjs": "^1.11.5", "echarts": "^5.3.3", "mobx": "^6.6.1", "mobx-react-lite": "^3.4.0", diff --git a/src/model/index.ts b/src/model/index.ts index 69cf4f0..e75f792 100644 --- a/src/model/index.ts +++ b/src/model/index.ts @@ -1,3 +1,5 @@ +import * as dayjs from 'dayjs' + export enum BillType { consume = 0, income, @@ -17,7 +19,7 @@ export interface IBill { export function EmptyBill(): IBill { const now = new Date(); return { - date: `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`, + date: dayjs().format("YYYY-MM-DD"), money: 0, type: BillType.consume, cls: "", diff --git a/yarn.lock b/yarn.lock index 5ce9df6..559b271 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1522,7 +1522,7 @@ date-fns@2.x: resolved "https://registry.npmmirror.com/date-fns/-/date-fns-2.29.2.tgz#0d4b3d0f3dff0f920820a070920f0d9662c51931" integrity sha512-0VNbwmWJDS/G3ySwFSJA3ayhbURMTJLtwM2DTxf9CWondCnh6DTNlO9JgRSq6ibf4eD0lfMJNBxUdEAHHix+bA== -dayjs@1.x, dayjs@^1.11.4: +dayjs@1.x, dayjs@^1.11.5: version "1.11.5" resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.5.tgz#00e8cc627f231f9499c19b38af49f56dc0ac5e93" integrity sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA==