Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Fix local time zone test
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomka committed Jan 16, 2018
1 parent 0e6663c commit e35cec1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Datetime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export default {
default: 'local'
},
format: {
type: Object
type: Object,
default: null
},
type: {
type: String,
Expand Down
9 changes: 6 additions & 3 deletions test/specs/Datetime.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
`<Datetime type="datetime" v-model="datetime"></Datetime>`,
`<Datetime type="datetime" v-model="datetime" :format="format"></Datetime>`,
{
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 () {
Expand Down

0 comments on commit e35cec1

Please sign in to comment.