diff --git a/packages/frontend/tests/acceptance/course/overview-test.js b/packages/frontend/tests/acceptance/course/overview-test.js index 28e85e4b9c..a4cc6e2fd7 100644 --- a/packages/frontend/tests/acceptance/course/overview-test.js +++ b/packages/frontend/tests/acceptance/course/overview-test.js @@ -45,13 +45,23 @@ module('Acceptance | Course - Overview', function (hooks) { await percySnapshot(assert); assert.strictEqual( page.details.overview.startDate.text, - 'Start: ' + this.intl.formatDate(courseModel.startDate), + 'Start: ' + + this.intl.formatDate(courseModel.startDate, { + day: '2-digit', + month: '2-digit', + year: 'numeric', + }), ); assert.strictEqual(page.details.overview.externalId.text, 'Course ID: 123'); assert.strictEqual(page.details.overview.level.text, 'Level: 3'); assert.strictEqual( page.details.overview.endDate.text, - 'End: ' + this.intl.formatDate(courseModel.endDate), + 'End: ' + + this.intl.formatDate(courseModel.endDate, { + day: '2-digit', + month: '2-digit', + year: 'numeric', + }), ); assert.strictEqual(page.details.overview.universalLocator, 'ILIOS' + courseModel.id); assert.strictEqual( @@ -72,13 +82,23 @@ module('Acceptance | Course - Overview', function (hooks) { await percySnapshot(assert); assert.strictEqual( page.details.overview.startDate.text, - 'Start: ' + this.intl.formatDate(courseModel.startDate), + 'Start: ' + + this.intl.formatDate(courseModel.startDate, { + day: '2-digit', + month: '2-digit', + year: 'numeric', + }), ); assert.strictEqual(page.details.overview.externalId.text, 'Course ID: 123'); assert.strictEqual(page.details.overview.level.text, 'Level: 3'); assert.strictEqual( page.details.overview.endDate.text, - 'End: ' + this.intl.formatDate(courseModel.endDate), + 'End: ' + + this.intl.formatDate(courseModel.endDate, { + day: '2-digit', + month: '2-digit', + year: 'numeric', + }), ); assert.strictEqual(page.details.overview.universalLocator, 'ILIOS' + courseModel.id); assert.strictEqual( @@ -177,12 +197,12 @@ module('Acceptance | Course - Overview', function (hooks) { }); const courseModel = await this.owner.lookup('service:store').findRecord('course', course.id); await page.visit({ courseId: courseModel.id, details: true }); - assert.strictEqual(page.details.overview.startDate.text, 'Start: 3/23/2013'); + assert.strictEqual(page.details.overview.startDate.text, 'Start: 03/23/2013'); await page.details.overview.startDate.edit(); assert.strictEqual(page.details.overview.startDate.datePicker.value, '3/23/2013'); await page.details.overview.startDate.datePicker.set('2013-04-23'); await page.details.overview.startDate.save(); - assert.strictEqual(page.details.overview.startDate.text, 'Start: 4/23/2013'); + assert.strictEqual(page.details.overview.startDate.text, 'Start: 04/23/2013'); }); test('start date validation', async function (assert) { @@ -195,7 +215,7 @@ module('Acceptance | Course - Overview', function (hooks) { }); const courseModel = await this.owner.lookup('service:store').findRecord('course', course.id); await page.visit({ courseId: courseModel.id, details: true }); - assert.strictEqual(page.details.overview.startDate.text, `Start: 3/23/2013`); + assert.strictEqual(page.details.overview.startDate.text, `Start: 03/23/2013`); assert.notOk(page.details.overview.startDate.hasError); await page.details.overview.startDate.edit(); assert.strictEqual(page.details.overview.startDate.datePicker.value, '3/23/2013'); @@ -214,12 +234,12 @@ module('Acceptance | Course - Overview', function (hooks) { }); const courseModel = await this.owner.lookup('service:store').findRecord('course', course.id); await page.visit({ courseId: courseModel.id, details: true }); - assert.strictEqual(page.details.overview.endDate.text, `End: 4/22/2015`); + assert.strictEqual(page.details.overview.endDate.text, `End: 04/22/2015`); await page.details.overview.endDate.edit(); assert.strictEqual(page.details.overview.endDate.datePicker.value, '4/22/2015'); await page.details.overview.endDate.datePicker.set('2016-05-22'); await page.details.overview.endDate.save(); - assert.strictEqual(page.details.overview.endDate.text, 'End: 5/22/2016'); + assert.strictEqual(page.details.overview.endDate.text, 'End: 05/22/2016'); }); test('end date validation', async function (assert) { @@ -232,7 +252,7 @@ module('Acceptance | Course - Overview', function (hooks) { }); const courseModel = await this.owner.lookup('service:store').findRecord('course', course.id); await page.visit({ courseId: courseModel.id, details: true }); - assert.strictEqual(page.details.overview.endDate.text, 'End: 4/22/2013'); + assert.strictEqual(page.details.overview.endDate.text, 'End: 04/22/2013'); assert.notOk(page.details.overview.endDate.hasError); await page.details.overview.endDate.edit(); assert.strictEqual(page.details.overview.endDate.datePicker.value, '4/22/2013'); diff --git a/packages/ilios-common/addon/components/course-materials.hbs b/packages/ilios-common/addon/components/course-materials.hbs index e5b9784122..2f07838563 100644 --- a/packages/ilios-common/addon/components/course-materials.hbs +++ b/packages/ilios-common/addon/components/course-materials.hbs @@ -204,7 +204,7 @@ {{#if lmObject.session.firstOfferingDate}} - {{format-date lmObject.session.firstOfferingDate}} + {{format-date lmObject.session.firstOfferingDate day="2-digit" month="2-digit" year="numeric"}} {{else}} {{t "general.none"}} {{/if}} diff --git a/packages/ilios-common/addon/components/course-overview.hbs b/packages/ilios-common/addon/components/course-overview.hbs index 64237358c5..4455459cfa 100644 --- a/packages/ilios-common/addon/components/course-overview.hbs +++ b/packages/ilios-common/addon/components/course-overview.hbs @@ -118,7 +118,7 @@ {{#if @editable}} @@ -129,7 +129,7 @@ {{else}} - {{format-date @course.startDate}}  + {{format-date @course.startDate day="2-digit" month="2-digit" year="numeric"}}  {{/if}} @@ -138,7 +138,7 @@ {{#if @editable}} @@ -149,7 +149,7 @@ {{else}} - {{format-date @course.endDate}}  + {{format-date @course.endDate day="2-digit" month="2-digit" year="numeric"}}  {{/if}} diff --git a/packages/ilios-common/addon/components/course-summary-header.hbs b/packages/ilios-common/addon/components/course-summary-header.hbs index f9878f7432..218dc9f9b4 100644 --- a/packages/ilios-common/addon/components/course-summary-header.hbs +++ b/packages/ilios-common/addon/components/course-summary-header.hbs @@ -37,7 +37,7 @@ {{t "general.startDate"}}: - {{format-date @course.startDate}} + {{format-date @course.startDate day="2-digit" month="2-digit" year="numeric"}}
@@ -53,7 +53,7 @@ {{t "general.endDate"}}: - {{format-date @course.endDate}} + {{format-date @course.endDate day="2-digit" month="2-digit" year="numeric"}}
diff --git a/packages/test-app/tests/integration/components/course-materials-test.js b/packages/test-app/tests/integration/components/course-materials-test.js index c0cd874f06..79dd824e1a 100644 --- a/packages/test-app/tests/integration/components/course-materials-test.js +++ b/packages/test-app/tests/integration/components/course-materials-test.js @@ -131,7 +131,7 @@ module('Integration | Component | course materials', function (hooks) { assert.strictEqual(component.sessions[0].type, 'Link'); assert.strictEqual(component.sessions[0].author, 'author1'); assert.strictEqual(component.sessions[0].sessionTitle, 'session1title'); - assert.strictEqual(component.sessions[0].firstOffering, '2/2/2020'); + assert.strictEqual(component.sessions[0].firstOffering, '02/02/2020'); assert.strictEqual(component.sessions.length, 3); assert.strictEqual(component.sessions[1].title, 'title2'); @@ -140,7 +140,7 @@ module('Integration | Component | course materials', function (hooks) { assert.strictEqual(component.sessions[1].type, 'File'); assert.strictEqual(component.sessions[1].author, 'author2'); assert.strictEqual(component.sessions[1].sessionTitle, 'session1title'); - assert.strictEqual(component.sessions[1].firstOffering, '2/2/2020'); + assert.strictEqual(component.sessions[1].firstOffering, '02/02/2020'); assert.strictEqual(component.sessions.length, 3); assert.strictEqual(component.sessions[2].title, 'title3 citationtext'); @@ -148,7 +148,7 @@ module('Integration | Component | course materials', function (hooks) { assert.strictEqual(component.sessions[2].type, 'Citation'); assert.strictEqual(component.sessions[2].author, 'author3'); assert.strictEqual(component.sessions[2].sessionTitle, 'session1title'); - assert.strictEqual(component.sessions[2].firstOffering, '2/2/2020'); + assert.strictEqual(component.sessions[2].firstOffering, '02/02/2020'); }); test('clicking sort fires action', async function (assert) { diff --git a/packages/test-app/tests/integration/components/course-summary-header-test.js b/packages/test-app/tests/integration/components/course-summary-header-test.js index 4f5c724a8a..83b7425074 100644 --- a/packages/test-app/tests/integration/components/course-summary-header-test.js +++ b/packages/test-app/tests/integration/components/course-summary-header-test.js @@ -59,9 +59,9 @@ module('Integration | Component | course summary header', function (hooks) { assert.dom(title).hasText('course 0'); assert.dom(printIcon).hasClass('fa-print'); assert.dom(rolloverIcon).hasClass('fa-shuffle'); - assert.dom(start).hasText('6/24/2005'); + assert.dom(start).hasText('06/24/2005'); assert.dom(externalId).hasText('abc'); - assert.dom(end).hasText('8/12/2005'); + assert.dom(end).hasText('08/12/2005'); assert.dom(level).hasText('3'); assert.dom(status).hasText('Published'); });