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

Commit

Permalink
Rename name attribute by hidden-name
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomka committed Jul 8, 2018
1 parent 5443450 commit f06fc41
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Parameter | Type | Default | Description
v-model (*required*) | ISO 8601 `String` | - | Datetime.
type | `String` | `date` | Picker type. date or datetime.
input-class | `String` | `''` | Class for the input.
name | `String` | `null` | Name for hidden input with raw value.
hidden-name | `String` | `null` | Name for hidden input with raw value. See #51.
value-zone | `String` | `UTC` | Time zone for the value.
zone | `String` | `local` | Time zone for the picker.
format | `String` | `DateTime.DATE_MED` or `DateTime.DATETIME_MED` | Input date format.
Expand Down
4 changes: 2 additions & 2 deletions src/Datetime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
v-on="$listeners"
@click="open"
@focus="open">
<input v-if="name" type="hidden" :name="name" :value="value">
<input v-if="hiddenName" type="hidden" :name="hiddenName" :value="value">
<transition-group name="vdatetime-fade" tag="div">
<div key="overlay" v-if="isOpen" class="vdatetime-overlay" @click.self="cancel"></div>
<datetime-popup
Expand Down Expand Up @@ -52,7 +52,7 @@ export default {
type: String,
default: ''
},
name: {
hiddenName: {
type: String
},
zone: {
Expand Down
10 changes: 5 additions & 5 deletions test/specs/Datetime.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Datetime.vue', function () {

it('should create hidden input if name is passed', function () {
const vm = createVM(this,
`<Datetime name="dt"></Datetime>`,
`<Datetime hidden-name="dt"></Datetime>`,
{
components: { Datetime }
})
Expand Down Expand Up @@ -421,7 +421,7 @@ describe('Datetime.vue', function () {
describe('hidden input value', function () {
it('should be empty when value is empty', function () {
const vm = createVM(this,
`<Datetime v-model="datetime" name="dt"></Datetime>`,
`<Datetime v-model="datetime" hidden-name="dt"></Datetime>`,
{
components: { Datetime },
data () {
Expand All @@ -437,7 +437,7 @@ describe('Datetime.vue', function () {
it('should be equal to value', function () {
const datetime = '2017-12-31T19:34:54.078Z'
const vm = createVM(this,
`<Datetime v-model="datetime" name="dt"></Datetime>`,
`<Datetime v-model="datetime" hidden-name="dt"></Datetime>`,
{
components: { Datetime },
data () {
Expand All @@ -451,7 +451,7 @@ describe('Datetime.vue', function () {
it('should be equal to value even when value is not valid', function () {
const datetime = '2017-12-32T19:34:54.078Z'
const vm = createVM(this,
`<Datetime v-model="datetime" name="dt"></Datetime>`,
`<Datetime v-model="datetime" hidden-name="dt"></Datetime>`,
{
components: { Datetime },
data () {
Expand All @@ -466,7 +466,7 @@ describe('Datetime.vue', function () {
const datetime1 = '2017-12-05T00:00:00.000Z'
const datetime2 = '2017-12-07T00:00:00.000Z'
const vm = createVM(this,
`<Datetime v-model="datetime" name="dt"></Datetime>`,
`<Datetime v-model="datetime" hidden-name="dt"></Datetime>`,
{
components: { Datetime },
data () {
Expand Down

0 comments on commit f06fc41

Please sign in to comment.