From e35cec180762fd15adf359a31eb47eac07a13970 Mon Sep 17 00:00:00 2001 From: Mario Juarez Date: Tue, 16 Jan 2018 10:10:42 +0100 Subject: [PATCH] Fix local time zone test --- src/Datetime.vue | 3 ++- test/specs/Datetime.spec.js | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Datetime.vue b/src/Datetime.vue index de44e44..5e0956a 100644 --- a/src/Datetime.vue +++ b/src/Datetime.vue @@ -54,7 +54,8 @@ export default { default: 'local' }, format: { - type: Object + type: Object, + default: null }, type: { type: String, diff --git a/test/specs/Datetime.spec.js b/test/specs/Datetime.spec.js index 70a9352..224c43f 100644 --- a/test/specs/Datetime.spec.js +++ b/test/specs/Datetime.spec.js @@ -297,17 +297,20 @@ describe('Datetime.vue', function () { it('should be a date in the local time zone by default', function () { const vm = createVM(this, - ``, + ``, { components: { Datetime }, data () { return { - datetime: '2017-12-07T19:34:54.078+03:00' + datetime: '2017-12-07T19:34:54.078+03:00', + format: LuxonDateTime.DATETIME_MED } } }) - expect(vm.$('.vdatetime-input').value).to.be.equal('Dec 7, 2017, 5:34 PM') + const localDateString = LuxonDateTime.fromISO('2017-12-07T19:34:54.078+03:00').toLocal().toLocaleString(LuxonDateTime.DATETIME_MED) + + expect(vm.$('.vdatetime-input').value).to.be.equal(localDateString) }) it('should be a date in the specified time zone', function () {