From b7b262861f0707c5d399d1a518e8fe428374ff54 Mon Sep 17 00:00:00 2001 From: teegoood Date: Sun, 4 Aug 2024 14:13:42 +0700 Subject: [PATCH] test: moment js --- package.json | 1 + pnpm-lock.yaml | 7 +++++++ src/app/rpkm/staff/home/page.tsx | 8 +++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 53384ce..09d031f 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "clsx": "^2.1.1", "dayjs": "^1.11.12", "framer-motion": "^11.3.8", + "moment": "^2.30.1", "next": "14.2.4", "next-image-zoom": "^1.1.7", "next-qrcode": "^2.5.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9dfb3de..b98bf2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ dependencies: framer-motion: specifier: ^11.3.8 version: 11.3.8(react-dom@18.3.1)(react@18.3.1) + moment: + specifier: ^2.30.1 + version: 2.30.1 next: specifier: 14.2.4 version: 14.2.4(react-dom@18.3.1)(react@18.3.1) @@ -3430,6 +3433,10 @@ packages: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} + /moment@2.30.1: + resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} + dev: false + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} diff --git a/src/app/rpkm/staff/home/page.tsx b/src/app/rpkm/staff/home/page.tsx index fe75848..8133deb 100644 --- a/src/app/rpkm/staff/home/page.tsx +++ b/src/app/rpkm/staff/home/page.tsx @@ -12,6 +12,7 @@ import { CheckIn } from '@/types/checkIn'; import { FRESHYNIGHT_EVENT, RPKM_DAY_1, RPKM_DAY_2 } from '@/utils/date'; import dayjs from 'dayjs'; import StudentCodeInput from '@/components/rpkm/staff/home/qrscanner/StudentCodeInput'; +import moment from 'moment'; function Page() { const [eventText, setEventText] = useState(''); @@ -87,7 +88,12 @@ function Page() {
ผู้ใช้สแกน QR-code นี้แล้ว
- {`เมื่อเวลา ${date.format('HH:mm')} น.`} +
{newCheckInData.checkIn.timestamp}
+
{`เมื่อเวลา ${date.format('HH:mm')} น.`}
+
+ {' '} + {`momentjs: ${moment(newCheckInData.checkIn.timestamp).format('HH:mm')} น.`} +
); setErrorTopic('Already taken!');