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

Commit

Permalink
Remove wrapper-class and input-class props. Use class attribute…
Browse files Browse the repository at this point in the history
… instead.
  • Loading branch information
mariomka committed Dec 20, 2017
1 parent 9ac6aa9 commit 5017b63
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## Work in progress

This is an alpha version, don't use in production. [More info](https://github.com/mariomka/vue-datetime/issues/28).
This is an alpha version, don't use yet in production. [More info](https://github.com/mariomka/vue-datetime/issues/28).

## Demo

Expand Down Expand Up @@ -93,13 +93,12 @@ type | `String`: date or datetime | date
value-zone | `String`: Value time zone | UTC
zone | `String`: Picker time zone | local
format | `String`: Input date format | `DateTime.DATE_MED` or `DateTime.DATETIME_MED`
wrapperClass | `String` | `null`

Input inherits all props not defined above.
Input inherits all props not defined above but `style` and `class` will be inherited by root element.

The component is based on [Luxon](https://github.com/moment/luxon), check out [documentation](https://moment.github.io/luxon/docs/index.html) to set [time zones](https://moment.github.io/luxon/docs/manual/zones.html) and [format](https://moment.github.io/luxon/docs/manual/formatting.html).

## Date localization
## Internationalization

Date internationalization depends on luxon. [Set the default locale](https://moment.github.io/luxon/docs/manual/intl.html#setting-the-default).

Expand Down
9 changes: 1 addition & 8 deletions src/Datetime.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<template>
<div class="vdatetime" :class="wrapperClass">
<div class="vdatetime">
<input class="vdatetime-input"
type="text"
:value="inputValue"
v-bind="$attrs"
v-on="$listeners"
:class="inputClass"
@click="open"
@focus="open">
<transition-group name="vdatetime-fade" tag="div">
Expand Down Expand Up @@ -39,12 +38,6 @@
format: {
type: Object
},
wrapperClass: {
type: String
},
inputClass: {
type: String
},
type: {
type: String,
default: 'date'
Expand Down
12 changes: 1 addition & 11 deletions test/specs/Datetime.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Datetime.vue', function () {
describe('render', function () {
it('should add class to wrapper', function () {
const vm = createVM(this,
`<Datetime wrapper-class="class-name"></Datetime>`,
`<Datetime class="class-name"></Datetime>`,
{
components: { Datetime }
})
Expand All @@ -24,16 +24,6 @@ describe('Datetime.vue', function () {
expect(vm.$('.vdatetime-input')).to.match('input')
})

it('should add class to input', function () {
const vm = createVM(this,
`<Datetime input-class="class-name"></Datetime>`,
{
components: { Datetime }
})

expect(vm.$('.vdatetime-input')).to.have.class('class-name')
})

it('input should inherit attributes', function () {
const vm = createVM(this,
`<Datetime placeholder="Select date..."></Datetime>`,
Expand Down

0 comments on commit 5017b63

Please sign in to comment.