From 4b7c08e2f9fe08ae0a9bc5a9be0f161f1fe5d6e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 7 Mar 2026 07:17:09 +0800 Subject: [PATCH] Fix moment format using month token MM instead of minute mm Co-Authored-By: Claude Opus 4.6 --- src/stores/conformance.ts | 2 +- tests/stores/conformance.test.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/stores/conformance.ts b/src/stores/conformance.ts index 28e6d28..096a4f8 100644 --- a/src/stores/conformance.ts +++ b/src/stores/conformance.ts @@ -181,7 +181,7 @@ export const useConformanceStore = defineStore('conformanceStore', { c.attributes.forEach(att => { switch (att.type) { case 'date': - att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:MM:ss') : null; + att.value = att.value !== null ? moment(att.value).format('YYYY/MM/DD HH:mm:ss') : null; break; case 'float': att.value = att.value !== null ? new Decimal(att.value).toFixed(2) : null; diff --git a/tests/stores/conformance.test.js b/tests/stores/conformance.test.js index e0a5a19..f68a5aa 100644 --- a/tests/stores/conformance.test.js +++ b/tests/stores/conformance.test.js @@ -181,5 +181,20 @@ describe('conformanceStore', () => { ]; expect(store.conformanceTask).toEqual(['A', 'B']); }); + + it('cases getter formats date attributes with correct minute token', () => { + store.allCases = [{ + started_at: '2023-06-15T10:30:00Z', + completed_at: '2023-06-15T11:45:00Z', + facets: [], + attributes: [{ + type: 'date', + value: '2023-06-15T14:30:00Z', + }], + }]; + const result = store.cases; + // The date attribute should show minutes (30), not month (06) + expect(result[0].attributes[0].value).toMatch(/:30:/); + }); }); });