From 5271fbe0f5806d82500e776bbef8a1d431f02356 Mon Sep 17 00:00:00 2001 From: Ryan Gurney Date: Wed, 9 Aug 2017 09:27:53 -0700 Subject: [PATCH] rg - Change Note component fecha date format string to use day of the month instead of day of the week --- src/components/Note.js | 2 +- test/components/Note.spec.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Note.js b/src/components/Note.js index 043b1911b..ef59c5f5e 100644 --- a/src/components/Note.js +++ b/src/components/Note.js @@ -52,7 +52,7 @@ class Note extends React.Component { {edited ? Edited : null} - {edited ? 'Last edited' : 'Posted'} {from ? by {from} : ' '} on {dateFormat(date, 'ddd, MMMM d, YYYY "at" h:mm A')} + {edited ? 'Last edited' : 'Posted'} {from ? by {from} : ' '} on {dateFormat(date, 'ddd, MMMM D, YYYY "at" h:mm A')} {from ? {from} : null}{dateFormat(date, 'M/d/YY h:mm A')} diff --git a/test/components/Note.spec.js b/test/components/Note.spec.js index 64cd8f8a2..618743124 100644 --- a/test/components/Note.spec.js +++ b/test/components/Note.spec.js @@ -8,7 +8,7 @@ import fecha from 'fecha'; describe('', () => { const note = { - date: new Date(), + date: new Date("November 5, 1605 00:00:00"), from: 'Jim Nabors', text: 'Hello World!', edited: true @@ -27,8 +27,8 @@ describe('', () => { }); it('should render date', () => { - const date = fecha.format(note.date, 'ddd, MMMM d, YYYY "at" h:mm A'); - assert.equal(date, component.ref('date').text()); + const expectedDate = 'Sat, November 5, 1605 at 12:00 AM' + assert.equal(expectedDate, component.ref('date').text()); }); it('should render edited', () => {